Part Number Hot Search : 
SMS012ZG MP354W TPA6130 KBL00501 CM71K 03952 MAX322 BCM856S
Product Description
Full Text Search
 

To Download N79E8221 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? n79a82x1 rev.1.20 ?? ?? nvm flash i/o (min/max) ? adc ? pwm ? n79a8251d20 16kb/256 256b 18/16 uart/i 2 c 4x10bit 4ch 4x10bit dip-20 n79a8251s20 16kb/256 256b 18/16 uart/i 2 c 4x10bit 4ch 4x10bit sop-20 n79a8241d20 8kb/256 256b 18/16 uart/i 2 c 4x10bit 4ch 4x10bit dip-20 n79a8241s20 8kb/256 256b 18/16 uart/i 2 c 4x10bit 4ch 4x10bit sop-20 n79a8231d20 4kb/128 128b 18/16 uart/i 2 c 4x10bit 4ch 4x10bit dip-20 n79a8231s20 4kb/128 128b 18/16 uart/i 2 c 4x10bit 4ch 4x10bit sop-20 n79a8231d16 4kb/128 128b 14/12 uart/i 2 c 3x10bit 3ch 4x10bit dip-16 n79a8231d14 4kb/128 128b 12/10 uart/i 2 c 1x10bit 2ch 4x10bit dip-14 n79a8221d20 2kb/128 128b 18/16 uart/i 2 c 4x10bit 4ch 4x10bit dip-20 n79a8221s20 2kb/128 128b 18/16 uart/i 2 c 4x10bit 4ch 4x10bit sop-20 ? ???? ?? 251 ?? a 2406 zip:210028 tel: 0086-25-83306839/83310926 fax: 0086-25-83737785 website: http://www.dycmcu.com/ free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 2 2007.8.16 ? ? 1 ............................................................................................................................................. 5 2 ............................................................................................................................................. 5 3 ??? ............................................................................................................................... 6 3.1 ? (rohs) ??? ........................................................................................ 6 4 ? ...................................................................................................................................... 7 5 ? ...................................................................................................................................... 8 6 ...................................................................................................................................... 9 6.1 ? flash eprom......................................................................................................... 9 6.2 i/o ? ............................................................................................................................ 9 6.3 (uart) ................................................................................................................. 9 6.4 ? ............................................................................................................................. 9 6.5 ................................................................................................................................. 9 6.6 ? ........................................................................................................................ 10 6.7 ? ........................................................................................................................ 10 6.8 cpu ? ....................................................................................................................... 10 6.8.1 alu ............................................................................................................................ .....10 6.8.2 ?(acc) ...................................................................................................................10 6.8.3 ? b...........................................................................................................................10 6.8.4 ???? (psw).................................................................................................11 6.8.5 ??? ram..................................................................................................................11 6.8.6 ?? ..........................................................................................................................11 7 ?? ............................................................................................................................... ..... 12 7.1 ? ........................................................................................................................ 12 7.2 ? .................................................................................................................... 12 7.3 ?? ................................................................................................................ 13 7.4 ? .................................................................................................................... 16 7.5 ?? ........................................................................................................................ 16 7.6 ? ............................................................................................................................... 16 8 ??? ......................................................................................................................... 17 9 ? ............................................................................................................................... ..... 18 9.1 ?? ........................................................................................................................ 18 9.2 ?? ........................................................................................................................ 18 10 ............................................................................................................................... ..... 19 10.1 ? ........................................................................................................................ 19 10.2 ?y (por) ............................................................................................................ 19 10.3 ?? ......................................................................................................... 19 10.4 ?? ........................................................................................................................ 19 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 3 2007.8.16 11 ............................................................................................................................... ............ 22 11.1 ? ........................................................................................................................... 22 11.2 ?? ................................................................................................................ 25 11.3 ........................................................................................................................ 25 12 ??? / ................................................................................................................. 28 12.1 ?/ 0&1 ......................................................................................................... 28 12.2 ?? ........................................................................................................................ 29 12.3 ?? 0............................................................................................................................. 2 9 12.4 ?? 1............................................................................................................................. 3 0 12.5 ?? 2............................................................................................................................. 3 0 12.6 ?? 3............................................................................................................................. 3 2 13 nvm ? ........................................................................................................................ 33 14 ?? ............................................................................................................................. 36 14.1 ? .................................................................................................................... 37 14.2 ???? ............................................................................................................. 37 15 (uart) ........................................................................................................................ .. 40 15.1 ?? 0............................................................................................................................. 4 0 15.2 ?? 1............................................................................................................................. 4 1 15.3 ?? 2............................................................................................................................. 4 2 15.4 ?? 3............................................................................................................................ 4 4 15.5 ? .................................................................................................................... 44 15.6 ? ........................................................................................................................ 45 16 ??? ............................................................................................................................. 47 17 (kbi)......................................................................................................................... .. 49 18 ?? ............................................................................................................................... .50 19 i/o ? .............................................................................................................................. 5 1 19.1 ????? ..................................................................................................... 51 19.2 ???? ......................................................................................................... 52 19.3 ??? ......................................................................................................... 53 19.4 ........................................................................................................................ 53 20 ............................................................................................................................... ......... 54 20.1 ??? ......................................................................................................... 54 20.2 cpu ??? ......................................................................................................... 54 21 ?? ............................................................................................................................. 54 21.1 ? ........................................................................................................................ 54 21.2 ?? ........................................................................................................................ 54 22 (pwm)......................................................................................................................... 5 6 23 ?? ......................................................................................................................... 62 23.1 adc ????? .............................................................................................. 64 24 i2c .............................................................................................................................. 6 8 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 4 2007.8.16 24.1 sio1? ....................................................................................................................... 68 24.2 i2c ?? : ............................................................................................................. 68 24.2.1 ?? , i2a ddr ..................................................................................................... 68 24.2.2 ?? , i2da t ........................................................................................................69 24.2.3 ?? , i2con .......................................................................................................69 24.2.4 i2c ?? , i2clk ...............................................................................................70 24.2.5 ??? , i2status .................................................................................................71 24.3 i2c ??? .............................................................................................................. 71 24.3.1 ?? ....................................................................................................................75 24.3.2 ?? ................................................................................................................76 24.3.3 ??? ....................................................................................................................77 24.3.4 ??? ....................................................................................................................78 24.3.5 gc ?? .........................................................................................................................79 25 icp( ? ) flash ................................................................................................... 80 26 ............................................................................................................................... ......... 81 26.1 config1 ...................................................................................................................... 81 26.2 config2 ...................................................................................................................... 82 27 ???? ................................................................................................... 82 28 ? ............................................................................................................................... .......... 111 28.1 ?? ...................................................................................................................... 111 29 dc/adc ? / ?? .................................................................................. 115 29.1 ? ...................................................................................................................... 115 29.2 dc ............................................................................................................... 115 29.3 adc ? dc ................................................................................................. 116 29.4 ?? ................................................................................................... 117 29.5 ac ................................................................................................................. 117 29.6 ?? .............................................................................................................. 117 29.7 ac ........................................................................................................................ 118 29.8 ?? .............................................................................................................. 118 30 ?? ............................................................................................................................... ... 119 30.1 20-pin so p ................................................................................................................. 119 30.2 20-pin di p ................................................................................................................... 12 0 30.3 16-pin pd ip................................................................................................................. 121 30.4 14-pin pd ip................................................................................................................. 122 31 ? ............................................................................................................................... ... 124 32 ............................................................................................................................... ... 125 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 5 2007.8.16 1 n79a82x1 ?? 51 ???? (icp) ? flash eprom ? ??? n79a82x1 ?????? 8052 ???? 16k/8k/4k/2k ? flash eprom 256/128 ?? nvm flash eprom 256/128 ? ram 2 8 ? ??i/o ?? 2 16- ? / 4 10 ad ? 4 10 pwm 2 ? 1 i2c 1 ????? 13 ?4 ??? n79a82x1 ?? flash eprom ?????????? n79a82x1 ?? ? (ice) ?? jtag ??????? 2 ? ??8 cmos 51 ????? 20mhz vdd=4.5v~5.5v ???? 20mhz vdd=2.7v~ 5.5v ???? 12mhz ? 16k/8k/4k/2k ????? (icp) ? flash eprom (ap flash eprom) ? 256/128 ?? ram ? 256/128 ? nvm flash eprom ? ? ? mcs-51 ? jtag ???? ? 2 8 ??? i/o ? ? 2 16- ? / ? ?13 ? 4 ? ????????? ? 4 i/o ????? ttl/ ??? ? ???? ? 4 10 pwm ? 4 10 adc ? 1 i2c ? ?( / ) ? 8 ? ?? ? ???? led (20ma) ? ?????? ? : ? jtag ice( ? ) ? icp( ? ) ? ? ? lead free (rohs) dip 20: n79a8251d20 ? lead free (rohs) sop 20: n79a8251s20 ? lead free (rohs) dip 20: n79a8241d20 ? lead free (rohs) sop 20: n79a8241s20 ? lead free (rohs) dip 20: n79a8231d20 ? lead free (rohs) sop 20: n79a8231s20 ? lead free (rohs) dip 20: n79a8221d20 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 6 2007.8.16 ? lead free (rohs) sop 20: n79a8221s20 3 ??? 3.1 ?(r ohs) ??? ?? eprom flash ram nvm flash adc pwm ? remark n79a8251d20 16kb 256b 256b 4x10bit 4x10bit dip-20 pin n79a8251s20 16kb 256b 256b 4x10bit 4x10bit sop-20 pin n79a8241d20 8kb 256b 256b 4x10bit 4x10bit dip-20 pin n79a8241s20 8kb 256b 256b 4x10bit 4x10bit sop-20 pin n79a8231d20 4kb 128b 128b 4x10bit 4x10bit dip-20 pin n79a8231s20 4kb 128b 128b 4x10bit 4x10bit sop-20 pin n79a8231d16 4kb 128b 128b 4x10bit 3x10bit dip-16 pin n79a8231d14 4kb 128b 128b 4x10bit 1x10bit dip-14 pin n79a8221d20 2kb 128b 128b 4x10bit 4x10bit dip-20 pin n79a8221s20 2kb 128b 128b 4x10bit 4x10bit sop-20 pin free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 7 2007.8.16 4 ? 20pin-dip20/sop20 16pin-dip16 14pin-dip14 ? n79a8231 ? dip16/dip14 ? pwm3/cmp2/p0.0 pwm2/p1.7 pwm1/p1.6 rst/p1.5 vss xtal1/p2.1 xtal2/clkout/p2.0 int1/p1.4 sda/int0/p1.3 scl/t0/p1.2 p0.1/cin2b/pwm0 p0.2/cin2a/brake p0.3/cin1b/ad0 p0.4/cin1a/ad1 p0.5/cmpref/ad2 vdd p0.6/cmp1/ad3 p0.7/t1 p1.0/txd p1.1/rxd 2 1 3 4 5 6 7 8 9 10 19 20 18 17 16 15 14 13 12 11 pwm3/cmp2/p0.0 pwm2/p1.7 rst/p1.5 vss xtal1/p2.1 xtal2/clkout/p2.0 sda/int0/p1.3 scl/t0/p1.2 p0.1/cin2b/pwm0 p0.3/cin1b/ad0 p0.4/cin1a/ad1 p0.5/cmpref/ad2 vdd p0.6/cmp1/ad3 p1.0/txd p1.1/rxd 2 1 3 4 5 6 7 8 15 16 14 13 12 11 10 9 pwm2/p1.7 rst/p1.5 vss xtal1/p2.1 xtal2/clkout/p2.0 sda/int0/p1.3 scl/t0/p1.2 p0.3/cin1b/ad0 p0.4/cin1a/ad1 p0.5/cmpref/ad2 vdd p0.6/cmp1/ad3 p1.0/txd p1.1/rxd 2 1 3 4 5 6 7 13 14 12 11 10 9 8 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 8 2007.8.16 5 ? ? st r (p1.5) i ? 2 ?????? xtal1 i 1: ??? xtal2 o 2: xtal1 ?? vss p vdd p ? p0.0 ? p0.7 i/o ?0 4 ?? 2 ?? p0.3~p0.6 ? adc ??? p1.0 ? p1.7 i/o ?1 4 ?? 2 ?? p1.2(scl) p1.3(sda) ???? p1.5 ??? ? p: ? i ?o i/o ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 9 2007.8.16 6 n79a82x1 ? 4 ? 8051 ???? 16k/8k/4k/2k ? flash eprom, 256/128 ? ram, 256/128 ? nvm flash eprom 2 8 ??? i/o ?? 2 16- ? / 4 10ad ? 4 10 pwm 1 i2c 1 ???? flash eprom ? ? icp ? 6.1 ? flash eprom n79a82x1 ?? 16k/8k/4k/2k ??????????? icp ?? 16k/8k/4k/2k? flash eprom icp ? / ??? ????????? ic ???????? 6.2 i/o ? n79a82x1 ? 2 8 ? i/o ??? i/o ? 16i/o ?? pxm1.y pxm2. ????? 4 ???????2?? ??? i/o ?? i/o ?????? i/o ??? 6.3 (u art) n79a82x1 ??????? 8052 ? n79a82x1 ?? ??????????? 6.4 ? n79a82x1 ? 2 16 ? 8052 ????????? ?? 4 ???? 12 ??????? 8052 ???? 6.5 n79a82x1 ????? 8052 ????????k? ?? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 10 2007.8.16 6.6 ? ?? 8052 ? n79a82x1 ? mcu 16 ? (dptr) auxr1 dps ? ? dptr dptr dps auxr1.0 dps=0 dps=1 6.7 ? ?? 8052 ? n79a82x1 ???? ??? cpu ??? ??????????????? 6.8 cpu ? n79a82x1 ???? 8052 ?? 8- alu ???? ? n79a82x1 ??? 8052 ?? 6.8.1 alu alu n79a82x1 ? mcu ?????????? ??? alu ???? alu ?? alu ??? acc ? b ????alu ?????? ?? (psw) 6.8.2 ?(acc) n79a82x1 ? mcu ??????? (acc) ??? ? cpu ????????? 6.8.3 ?b ?? b ?8 ?? / ????? b ?? ?? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 11 2007.8.16 6.8.4 ???? (psw ) psw ? 8 ?? alu ?????? ????? 6.8.5 ???ra m n79a82x1 ? 256/128 ???? ram ??????? ???? 6.8.6 ?? n79a82x1 ?? 8- ??????? ??? ram ???? ram ? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 12 2007.8.16 7 ?? n79a82x1 ??? 2 ?????? ????? 7.1 ? n79a82x1 ? 16k/8k/4k/2k ???????? movc ? ?? 7.2 ? n79a82x1 ? 256/128 A? nvm ??? ? movc a,@a+dptr ? ? nvmaddr, nvmdat nvmcon ?? 0000h external data memory space on-chip code memory space 0000h 16k/8k bytes on-chip code memory unused code memory unused code memory config 1 3fffh 4000h ffffh ffffh page 0 64 bytes page 1 64 bytes page 2 64 bytes page 3 64 bytes fc00h fc3fh fc40h fc7fh fc80h fcbfh fcc0h fcffh nvm data memory area fc00h config 2 fcffh 256 bytes nvm data memory unused data memory fbffh w79e825/w79e824 memory map free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 13 2007.8.16 0000h external data memory space on-chip code memory space 0000h 4k/2k/1k bytes on-chip code memory unused code memory unused code memory 0fffh 1000h ffffh ffffh page 0 64 bytes page 1 64 bytes fc00h fc3fh fc40h fc7fh nvm data memory area fc00h fc7fh 128 bytes nvm data memory unused data memory config 1 config 2 w79e823/w79e822 memory map 7.3 ?? n79a82x1 ??????? 256/128 ??? ram ?? ??? ( ??? ) sfr ?????? ram ?? ?????? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 14 2007.8.16 in d i re c t ram a ddressing di re c t & in d i re c t ram a ddressing sfr di re c t a ddressing onl y 00h 7fh 80h ffh r a m and s fr d ata m em ory s pace w79e825/w79e824 ram a nd sfr memory map unused indirect ram direct & indirect ram addressing sfr direct addressing only 00h 7fh 80h ffh ram and sfr data memory space w79e823/w79e822 ram and sfr memory map ?ram ? 256/128 ??????????? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 15 2007.8.16 bank 0 bank 1 bank 2 bank 3 03 02 01 00 04 05 06 07 0b 0a 09 08 0c 0d 0e 0f 13 12 11 10 14 15 16 17 1b 1a 19 18 1c 1d 1e 1f 23 22 21 20 24 25 26 27 2b 2a 29 28 2c 2d 2e 2f 33 32 31 30 34 35 36 37 3b 3a 39 38 3c 3d 3e 3f 43 42 41 40 44 45 46 47 4b 4a 49 48 4c 4d 4e 4f 53 52 51 50 54 55 56 57 5b 5a 59 58 5c 5d 5e 5f 63 62 61 60 64 65 66 67 6b 6a 69 68 6c 6d 6e 6f 73 72 71 70 74 75 76 77 7b 7a 79 78 7c 7d 7e 7f direct ram indirect ram 00h 07h 28h 08h 0fh 10h 17h 18h 1fh 20h 21h 22h 23h 24h 25h 26h 27h 29h 2ah 2bh 2ch 2dh 2eh 2fh 30h 7fh 80h ffh free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 16 2007.8.16 7.4 ? ?? 8 8- ???? 1 2 3 4 ?? ??????? r0 r1 r2 r3 r4 r5 r6 r7 ??? psw ? rs0 rs1 ?? r0 r1 ????? 7.5 ?? ?ram 20h 2fh ???????????? ?????????? 0 8 ??? 7.6 ? ?ram ???? (sp) ? sp ???????? ???? ram ????????? 07h ? ????? sp ????? sp1 ???? ?sp1 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 17 2007.8.16 8 ??? n79a82x1 ? mcu ???? ( ??? ) ???? ?? 80h-ffh ????????????????? ???????????????? ? 0 8 n79a82x1 ??? 8052 ?????? ??????? 8052 ???? n79a82x1 ???? 1 ??? f8 ip1 f0 b p0ids ip1h e8 ie1 e0 acc adccon adch d8 wdcon pwmpl pwm 0l pwm1l pwmcon1 pwm2l pwm3l pwmcon2 d0 psw pwmph pwm0h pwm1h pwm2h pwm3h pwmcon3 c8 nvmcon nvmdat c0 i2con i2addr nvmaddr ta b8 ip0 saden i2data i2status i2clk i2timer b0 p0m1 p0m2 p1m1 p1m2 p2m1 - ip0h a8 ie saddr cmp1 cmp2 a0 - kbi auxr1 98 scon sbuf 90 p1 divm 88 tcon tmod tl0 tl1 th0 th1 ckcon 80 p0 sp dpl dph pcon ?? 1 ?????????? 2 ? n79a82x1 ????? 8 ?????????? ???? 1 ? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 18 2007.8.16 9 ? n79a82x1 ???????????????? 9.1 ?? ?? 1 pcon.0 ??????????????? ???????? cpu ??????? ? cpu ????????????? ??? ale psen ???????????????? ?2 ????????????? ??????????????? ???????????? ??????????? rst ???y?? ??????? 2 ? 8 ??????? ???? 0000h sfr ??????????? ?????????????? ????????????? 512 ???? n79a82x1 ???????????? ?? ??? pcon ? : 87h bit: 7 6 5 4 3 2 1 0 smod smod0 bof por gf1 gf0 pd idl 1 pd 1 ??????????? . 0 idl 1 ?????? cpu ????? ???????? . 9.2 ?? ?? 1 pcon.1 ??????????????? ???????????????????? ???????? sfr ??? ?????????????? rst ??? ?????????? 0000h ???????? ????????? ea=1 ?????????????? ??????????????? ????? isr ???????? ?? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 19 2007.8.16 10 ????? n79a82x1 ?????????? ????????????? ? 2 ???? 1. ??? 2. ?? 10.1 ? ???? c4 ?rst ??? rst ?????? 2 ?????? rst ?????????? ???????? ???????? rst ?????????????? rst ?? ??? 2 ?????? 0000h ????? ?????? 2 ???????? 2 ? ???????? 10.2 ?y (p or) ?? por ?????????? vdd vrst, ?????????????y?? por ? 10.3 ?? ??????????? ?????????????? ?????? 512 ????? ???????????? 2 ??????? 0000h ?? 10.4 ?? sfr ?????? 0000h ???????? ? 0000h ????? ram ?? ram ????? ??? 07h ????? vdd 2v ? ram ? ?ram ???????y ram ???? 2v ram ?? sfr ???????y???? ???? ff ????????p0 ???? ?? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 20 2007.8.16 ????? ??? value ??? value p0 11111111b i2dat xxxxxxxxb sp 00000111b i2status 00000xxxb dpl 00000000b i2timer 00000000b dph 00000000b i2clk 00000000b pcon 00xx0000b i2con 00000000b tcon 00000000b i2addr xxxxxxxxb tmod 00000000b ta 00000000b tl0 00000000b psw 00000000b tl1 00000000b pwmph xxxxxx00b th0 00000000b pwm0h xxxxxx00b th1 00000000b pwm1h xxxxxx00b ckcon 00000000b pwm2h xxxxxx00b p1 1111xx11b pwm3h xxxxxx00b divm 00000000b wdcon 0x000000b scon 00000000b pwmpl 00000000b sbuf xxxxxxxxb pwm0l 00000000b - - pwm1l 00000000b kbi 00000000b pwmcon1 00000000b auxr1 00000000b pwm2l 00000000b ie 00000000b pwm3l 00000000b saddr 00000000b pwmcon2 00000000b cmp1 00000000b pwmcon3 xxxxxxx0b cmp2 00000000b acc 00000000b p0m1 00000000b adccon xx000x00b p0m2 00000000b adch xxxxxxxxb p1m1 00000000b eie xx000000b p1m2 00000000b b 00000000b p2m1 00000000b p0ids 00000000b - - iph xx000000b ip0h x0000000b ip1 xx000000b ip0 x0000000b nvmaddr 0000 0000b saden 00000000b nvmdat 0000 0000b nvmcon 00xx xxxxb 10-1: sfr ? wdcon ????? / 0 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 21 2007.8.16 ? ?? ?y wdcon 0x0x0xx0b 0x0x01x0b 01000000b por wdcon.6 ?y??? pfi wdcon.4 ?1? ?y ?0? wtrf wdcon.2 ??? ?1?, ?y ?0? ewt wdcon.1 ? ?y?????????? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 22 2007.8.16 11 n79a82x1 ? ? 4 ? 13 ????? ?? ??????? 11.1 ? ? int0 int1 it0 it1 ????? tcon ie0 ie1 ??? 2 ???????????? ?? intx ??????????? ????????? iex ????????? ?????????????? ??????? iex ????? ??????????????? iex ??? ????????????? tf0 tf1 ???? 0 ?? 1 ?????? ???????? ???????????????? ???? wdif wdcon.3 eie.4=1 ???? ???????? scon ri ti ? ?1? ? ?0? ? ?0? ??? / ????? ie ?????? ie ???????? adc ?? adc ? adc ????? adccon adci ?? ?0? ? ?0? ???? cmf1 cmf2 ? ?0? ? ?0? i2c ???? si si??1 ? i2c ? i2c ?? ?0? ? ?0? pwm ???? bkf ????????? ?0? ? ?0? ?? ????? 3 ?????????? ??????????????? ????????????? ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 23 2007.8.16 ?? ? ? ? ? 0 ie0 1( ) ?? bof 2 ?? wdif 3 ?0 tf0 4 i2c si 5 adc adci 6 ? 1 ie1 7 kbi kbf 8 ?1 cmf1 9 ?1 tf1 10 ?2 cmf2 11 ri + ti 12 pwm bkf 13 ( ) ????????? lcall ?? ??? lcall ? 1. ?????????? 2. ?????? 3. ??? ieie1 ip0 ip0h ip1 iph1 ???? reti. ?? lcall ???????? ???? ?1? ??????? ???? ????? lcall ??????? ??????? tf0 tf1 ??? ? int0 int1 ?????????? ???? wdif ?????? ????? psw ?? pc ??? ? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 24 2007.8.16 ?? ? ? ? ? ? 0 0003h ?0 000bh ? 1 0013h ?1 001bh 0023h ?? 002bh i2c 0033h kbi 003bh ?2 0043h - 004bh ?? 0053h adc 005bh ?1 0063h - 006bh pwm ? 0073h - 007bh ?? ? ipxh ipx ? 0 0 0 ( ? ) 0 1 1 1 0 2 1 1 3 ( ? ) ???????? ?? reti ?? reti ?????? pc ??? ???????????? cpu ? ?????? pc ?? n79a82x1 ? 4 ??? n79a82x1 ???? n79a82x1 ??? 13 ?. ??? ien0 ien1 ? ien0 ?????? ea ???? ????? 4 ????? ip0, ip0h, ip1 ip1h ????????????? ?????? 2 ????? ??????????? ???????? cpu ??? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 25 2007.8.16 ?? ? ? ? ? ? ? 0 ie0 0003h ex0 (ie0.0) ip0h.0, ip0.0 1( ) ?? bof 002bh ebo (ie.5) ip0h.5, ip0.5 2 ?? wdif 0053h ewdi (ie1.4) ip1h.4, ip1.4 3 ?0 tf0 000bh et0 (ie.1) ip0h.1, ip0.1 4 i2c si 0033h ei2 (ie1.0) ip1h.0, ip1.0 5 adc ? adci 005bh ead (ie.6) ip0h.6, ip0.6 6 ? 1 ie1 0013h ex1 (ie.2) ip0h.2, ip0.2 7 kbi kbf 003bh ekb (ie1.1) ip1h.1, ip1.1 8 ?1 cmf1 0063h ec1 (ie1.2) ip1h.2, ip1.2 9 ?1 tf1 001bh et1 (ie.3) ip0h.3, ip0.3 10 ?2 cmf2 0043h ec2 (ie1.3) ip1h.3, ip1.3 11 tx rx ti & ri 0023h es (ie.4) ip0h.4, ip0.4 12 pwm bkf 0073h epwm (ie1.5) ip1h.5, ip1.5 13 ( ) ??? rc ???? adc ??????? 11.2 ?? ??????????? int0 ri+ti ? ? c3 ??? iex ?? 0 1 ??? c3 ???? 1 3 ???? ?? 4 ??????? 5 ? ?????????????? ????????????? ??????? ( ?? ) n79a82x1 ?? ie, ie1, ip0, ip0h, ip1 ip1h mul div ?????? 12 ? 1 ? ie, ie1, ip0, ip0h, ip1 ip1h 2 ? mul div ?5 ?? lcall ? 4 ? ???????? 5 ?? 12 ???? 12 ?48 ???? 8051 ??? 8 ? 96 ?? ? 50% ?? 11.3 n79a82x1 ? 13 ????? ie0,ie1, bof, kbf, wdt, adc, free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 26 2007.8.16 cmf1 cmf2 ?? if0, if1, ri+ti ,si bkf. 2 ??? 80c51 ? ? n79a82x1 ???????? cpu ? ie0 ex0 ie1 ex1 bof ebo kbf ekb adci eadc wdt ewdi cm1 ec1 cm2 ec2 ea wakeup (if in power down) interrupt to cpu free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 27 2007.8.16 ??????? ei2 si es ri+ti et1 tf1 et0 tf0 ea interrupt to cpu bkf epwm free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 28 2007.8.16 12 ??? / n79a82x1 ? 2 16 ??? / ???????? ? 3 ? 12.1 ? / 0&1 n79a82x1 ? 2 16 ?/ ? 2 8 ?? 16 ?? ?? 0 th0 8 ?? tl0 8 ??? 1 ??? ? th1 tl1 ??????? ????????????? 12 ?????4 ??????????? t0 ?? 0 t1 ?? 1 ???? t0 t1 ????? c4 ?? ???????????????? ??? 2 ??????????? ?24 ???????? c3 ?????? t0 t1 ??????????? 1 tmod ? ct / ?? / ????? / ?? ?? tmod ? 2 ?? / 0 ?? 6 ?? / 1 ??? ?/ ? 4 ?? tmod m0 m1 ??? ?? ? 0 ? tl0 ? : 8ah bit: 7 6 5 4 3 2 1 0 tl0.7 tl0.6 tl0.5 tl0.4 tl0.3 tl0.2 tl0.1 tl0.0 ? 1 ? tl1 ? : 8bh bit: 7 6 5 4 3 2 1 0 tl1.7 tl1.6 tl1.5 tl1.4 tl1.3 tl1.2 tl1.1 tl1.0 ? 0 ? th0 ? : 8ch bit: 7 6 5 4 3 2 1 0 th0.7 th0.6 th0.5 th0.4 th0.3 th0.2 th0.1 th0.0 ? 1 ? th1 ? : 8dh bit: 7 6 5 4 3 2 1 0 th1.7 th1.6 th1.5 th1.4 th1.3 th1.2 th1.1 th1.0 ????? tmod ? : 89h bit: 7 6 5 4 3 2 1 0 gate tc / m1 m0 gate tc / m1 m0 timer1 timer0 7 gate ?? 1 ?, ?/ trx ? n int ? trx n int ?1 ?? / ?? 0 ??? trx ? 6 tc/ ?/ ??? 0 ?????? 1 ? tx ??? ? 5 m1 ??? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 29 2007.8.16 4 m0 ??? 3 gate ?? 1 ?, ?/ trx ? n int ? trx n int ?1 ?? / ?? 0 ??? trx ? 2 tc/ ?/ ??? 0 ?????? 1 ? tx ??? ? 1 m1 ??? 0 m0 ??? ??? : m1 m0 ?? 0 0 ?? 0: 8- ? 5 ?? 0 1 ?? 1: 16- ?? 5 ?? 1 0 ?? 2: 8 thx ??? 1 1 ??3: t0 tl0 ?? 0 ?8 ? / th0 ?? 1 ? 8 ? / ? 1 ???2 12.2 ?? n79a82x1 ???? 2 ????? 8051 ?????? 1/12 ?? ?????? 8051 ?? n79a82x1 ??????? ???????????????? 1/4 ? ??? 3 ckcon t0m t1m ??????? 0 ? ?? 8051 ???????? ???? ckcon ? : 8eh bit: 7 6 5 4 3 2 1 0 - - - t1m t0m - - - 4 t1m ?1 ?? 0: ?1 ??? 1/12 ???? 1: ?1 ??? 1/4 ???? 3 t0m ? 0 ?? : 0: ? 0 ??? 1/12 ???? 1: ? 0 ??? 1/4 ???? 12.3 ?? 0 ??0 13 ?? / 8 thx tlx ?5 ? tlx ? 3 ? tlx ? ???? tlx ? 1 0 thx ? thx ? ff?00 ? tcon ? tfx trx gate ?0 intx ?1 ? ct / =0 ?? / ?? ct / =1 ? p1.2(t0) ? p0.7 t1 ? 1 0 13 ???? 1fffh ??? 0000h ??????????? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 30 2007.8.16 ?????????? 1/121/4 fcpu 1/12 0 1 047 07 tfx th0 ( th1) tl0 ( tl1) in te rru p t t0o e t0=p1. 2 (c / t =t m o d . 6) c/ t =t m o d .2 gate =t m o d .3 (g a t e =t m o d . 7) in t0=p1. 3 (in t1 = p 1 . 4) t1= ( p0. 7) p1. 2 ( p0. 7) tf0 ( tf1) t r0=t c o n .4 t r1=t c o n .6 (t 1 o e) 1/ 4 t0m=ckcon .3 (t 1 m = c k c o n . 4) 0 1 ? / ?? 0 12.4 ?? 1 ??1 ?? 0 ????? 1 ?? / ? 16 ? 13 ? thx tlx ? 16 ? ffffh 0000h ??? 1 ???? ?? 0 ?????????? 0 ? fcpu 1/12 0 1 047 07 tfx th0 (t h 1 ) tl0 (tl1) interrupt t0o e t0=p1.2 (c /t =tm o d.6) c/t =tm o d.2 gate=tmod.3 (g a t e = t m o d .7 ) in t0=p1.3 (in t1=p1.4) t1=(p0.7) p1. 2 (p 0 . 7) tf0 (t f 1 ) tr0=tc o n.4 tr1=tc o n.6 (t 1 o e ) 1/ 4 0 1 t0m =c k c o n.3 (t1m =c k c o n.4) ? / ?? 1 12.5 ?? 2 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 31 2007.8.16 ??2 ?? / ??????? tlx ?8 ? thx ?? tlx ffh 00h tcon tfx ?thx ? tlx ?? thx ???? trx gate ?0 intx ?1 ??? 2 ?? ??? 2 ?????? 1/12 1/4 ??tn ? 0 1 07 07 tfx th0 (t h 1 ) tl0 (tl1) interrupt t0o e t0=p1.2 (c /t =tm o d.6) c/t =tm o d.2 gate=tmod.3 (g a t e = t m o d .7 ) in t0=p1.3 (in t1=p1.4) t1=(p0.7) p1. 2 (p 0 . 7) tf0 (t f 1 ) tr0=tc o n.4 tr1=tc o n.6 (t 1 o e ) fcpu 1/12 0 1/ 4 0 1 t0m =c k c o n.3 (t1m =c k c o n.4) ? / ?? 2. free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 32 2007.8.16 12.6 ?? 3 ??? 3 ?????? / 1 ??? 3 ????? / 0 ? ??3 tl0 th0 2 8 ????????? 3 tl0 ?? 0 ? ct / , gate, tr0, int0 tf0 tl0 ??? 1/12 1/4 ? t0 ?1 0 th0 ???????? / 1 ? tr1 tf1 ? 8 ????? 3 ? 0 ?? 3 ?? 1 ? ??? 0 1 2 ???????? tf1 tr1 ??? 1 ?? gate int1 ????? 3 ?? ????? 0 1 07 07 tf0 th 0 tl0 interrupt t0o e t 0=p 1.2 c/t =tm o d.2 gate=tmod.3 in t 0 = p 1 .3 p1. 2 tr0=tc o n.4 tr1=tc o n.6 tf1 interrupt t1o e p0. 7 fcpu 1/12 0 1/4 0 1 t0m =ckco n.3 (t 1m =c k c o n.4) ? / ?? 3. free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 33 2007.8.16 13 nvm ? n79a82x1 ? 256/128 ?? nvm ? 256/128 ? nvm ?? 4/2 ?? ? 64 ?? 0 ??? fc00h ~ fc3fh 1 ??? fc40h ~ fc7fh 2 ??? fc80h ~ fcbfh 3 ??? fcc0h ~ fcffh. ?? nvm ? nvm movc a,@a+dptr ???? nvmaddr nvmdat nvmcon ? nvm ?????? ?? ??????? nvmaddr ? nvmcon.7 eer ??????? ( ?) ? pc ??? ????? 5ms. nvm ????? nvmaddr nvmdat ewr(nvmcon.6) ?uc ????????? ??? 50us 0000h external data memory space on-chip code memory space 0000h 16k/8k bytes on-chip code memory unused code memory unused code memory config 1 3fffh 4000h ffffh ffffh page 0 64 bytes page 1 64 bytes page 2 64 bytes page 3 64 bytes fc00h fc3fh fc40h fc7fh fc80h fcbfh fcc0h fcffh nvm data memory area fc00h config 2 fcffh 256 bytes nvm data memory unused data memory fbffh w79e825/w79e824 memory map free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 34 2007.8.16 7~0 nvmaddr.7 ~ nvmaddr.0 nvm ?: ?????????? nvm ? ? : nvmaddr ?: c6h 7 eer nvm ? 0: nvm ? 1: ? ?1? nvm ?? ?ffh? nvm ? 4 ??? ?64 ??? nvmaddr ???????? ????????????? nvm ??? 6 ewr nvm 0: nvm . 1: ???1? nvm ?????????? ??????? 5~0 - ?: nvmcon ?: ceh nvm ?? : page ?? ? 0 00h 3fh 1 40h 7fh 2 80h bfh 3 c0h ffh ? : w79e823, w79e822 w79e821 ?? 2 ? 3. 7~0 nvmdat.7 ~nvmdat.0 nvm ?? nvm ? movc ?. ?: nvm ?: cfh free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 35 2007.8.16 void erasenvmpage(unsigned char erasepage_num) { switch(erasepage_num) { case 0: nvmaddr=0x00; // nvm 0 ? break; case 1: nvmaddr=0x40; // nvm 1 ? break; case 2: nvmaddr=0x80; // nvm 2 ? break; case 3: nvmaddr=0xc0; // nvm 3 ? break; default: break; } nvmcon|=0x80; // eer = 1 ? } void writenvm(unsigned char nvm_waddr,unsigned char nvm_wdata) { nvmdat = nvm_wdata; // nvmaddr = nvm_waddr; // ? nvmcon |= 0x40; // ewr = 1 nvm } free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 36 2007.8.16 14 ?? ????????????? ?????????????? ????????????? ?? 2 ????????????? ?? wdif 512 clock delay mux 500k h z r c o sci ll ator uc cl ock wdte w drun wd1,wd0 wdclr ew di ew rst reset interrupt 00 01 10 11 w drf 26-bits c ounter ti me-out sel ector 16 0 17 19 20 22 23 25 (r esetw atchdog) (w d c o n .1 ) (w d c o n .3 ) (ie1.4) (w dcon.2) (w d c o n .0 ) (w dcon.7) (s ecuri ty b it) (w d c o n .5 /4 ) /e nabl e ? ? ??? wdclr ????????? wdclr ??? 0 ?? 1 ????? 0 rwt ? 1 ???????? wd1 wd0 wdcon.5 wdcon.4 ???? wdif(wdcon.3) ????? 512 ? ? ewrst (wdcon.1) =1 ???? wdclr ? 512 ?? ??? 2 ?? wtrf(wdcon.2) ??? ????? ?????????????????? wdif ? wdif ?????? rwt ??? ??????????????? ea=1 ???? ??????????????? ?????????? ????????????? ??????????????? ???????????????? ?????????????? 512 ?? ??? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 37 2007.8.16 wd1 wd0 ? interval number of ? ? @ 10 mhz 0 0 217 131072 13.11 ms 0 1 220 1048576 104.86 ms 1 0 223 8388608 838.86 ms 1 1 226 67108864 6710.89 ms ???y???????? ??????? ???? 14.1 ? wdif wdcon.3 ? ? ??????? ?1? ? (ie1.4)=?1? ? ( ?? ?1? ?) ? ?0? wdrf wdcon.2 ?????? ?1? ?? ????y? ewdrst = 0 ? ???? ewrst: wdcon.1 ???? 1 ?????? 0 ??? ??? wdclr wdcon.0 ? ??????? ?? 1 ??? 0 ???????? ? 512 ?????????? 14.2 ???? wd1, wd0: ckcon.5, ckcon.4 ? ????? 2 ??? ???? 512 ?? ????? 217 ????? ewt,wdif rwt ??? ??????????????? ? wdte config ?? 7 ??????? rc ? wdte 0 ??? 500khz ??????? ??? wdclr 0 ????? pcon cpu ? ?????? 1/ 0 wdclr ? 1 ???? cpu ????????? ? wdclr ??????? 0 ??? wdclr ?? cpu ?????? wdclr ??? wdcon ? : d8h free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 38 2007.8.16 bit: 7 6 5 4 3 2 1 0 wdrun - wd1 wd0 wdif wtrf ewrst wdclr 7 wdrun 0: ??? 1: ? . 5~4 wd1~wd0 ? ?? . 3 wdif ????????? 1 ??? ???????????? ? 2 wtrf ?????????? ????y? ewt 0 ???? 1 ewrst 0: ??? . 1: ??? . 0 wdclr ?? ?0? wdcon.0 ? ????? ???? 1 ??? 0 ????????? 512 ? ???????? void wdt_isr(void) interrupt 10 { // ??????? ta = 0xaa; ta = 0x55; wdcon = 0x00; // ????? ta = 0xaa; ta = 0x55; wdcon |= 0xe3; // ? } void main(void) { ta = 0xaa; /* ? ta ? aah 55h ?? */ ta = 0x55; wdcon = 0x00; // ??????? ta = 0xaa; ta = 0x55; wdcon |= 0xe3; // ?? 2^23 ?? ewdi = 1; // ?? ea = 1; // free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 39 2007.8.16 } free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 40 2007.8.16 15 (uart) n79a82x1 ????? n79a82x1 ????????? ???????????????????? ?????????????? sbuf ?sbuf ?? sbuf ??? 4 ???? . ? sbuf ? : 99h bit: 7 6 5 4 3 2 1 0 sbuf.7 sbuf.6 sbuf.5 sbuf.4 sbuf.3 sbuf.2 sbuf.1 sbuf.0 7~0 sbuf ????????? 2 8 ???????? ?? ??? scon ? : 98h bit: 7 6 5 4 3 2 1 0 sm0/fe sm1 sm2 ren tb8 rb8 ti ri 7 sm0/fe 0 ?? 0 ? pcon ??? smod0 ?? sm0 ???? ????? 6 sm1 ?? 1 sm0 sm1 ?? ? ? 0 0 0 ? 8 ??4 12 ?? 0 1 1 ? 10 ? 1 0 2 ? 11 ??64 32 ?? 1 1 3 ? 11 ? 5 sm2 ??? 1 ??? 2 ?? 3 ?????? 2 3 sm2 1 ???? rb8 0 ? ri ?? 1 sm2 1 ?????? ri ???? 0 sm2 ???? 0 ??????? 12 ? ??? 8052 ? 1 ??????? 4 ??????? 4 ren ?? 1 ???????? 3 tb8 ??2 3 ???????? 1 0 2 rb8 ??2 3 ?????? 1 sm2=0 rb8 ???? ??0 ? 1 ti ???? 0 ????? 8 ??? ???????? 15.1 ?? 0 ???????????? rxd ?? txd ?????? txd ?? n79a82x1 ??????? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 41 2007.8.16 ????? 8 ??????????? 1/121/4 sm2 scon.5 sm2=0 ????? 1/12 sm2=1 ? ???? 1/4 ?? 0 ?????? 8051 n79a82x1 ??? ??? 0 ??? rxd ?? txd ????? n79a82x1 ? / ? sbuf ????? rxd ??? 8 ? sm2=1 txd ????? rxd ? ?? 1 ??? txd ????? 2 ??? txd ??? sm2=0 rxd ? txd ?? 3 ??? txd ?? 6 ??? ??????? txd ?? txd ?? 1/12 fcpu 0 tx clock rx clock ti ri tx shift rx start rx shift load sbuf shift clock ri ren sm2 clock sin parout sbuf read sbuf internal data bus serial controllor clock load parin tx start internal data bus sbuf write to sout transmit shift register serial interrupt rxd txd rxd p1.1 alternate input function p1.1 alternate output function p1.0 alternate output function 1/4 1 ?? 0 ti ???? c1 ?1 ren=1 ri=0 ?????? ?????????????? ? 8 ?? ri txd ??? 1 ?? ri ? ? 15.2 ?? 1 ??1 ?????? 10 ? rxd txd ? ?10 ??? 0 8 ??? 1 ????? scon rb8 ???2?????? 1 ? 1/16 1/32 ?? 1 ????????? sbuf ??????? 16 ?????c1 ?? txd ??? 16 ???c1 ? txd ??? 16 ??????? sbuf ? 9 ?????? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 42 2007.8.16 ?? txd ? ti c1 ?? sbuf ? 16 ??? 11 ? ??? ren=1 ?????? 16 ?? rxd ?? ren=?1? ??? rxd ?? 1-0 ??? rxd 16 ?????? 16 ????0? ?????? 16 ???1 ??? 16 ???3 ???? 8 9 10 ? 3 ??? rxd ??? 3 2 ???????? rxd ??? rxd ? 0 ?????? 1-0 ? ?? 0 ???????? ? ? 8 ?????? rb8 ? ri ? ri ?1? ?? ? ri=0 sm2=0 ???? 1 ? ??? rb8 8 ? sbuf ri ??? ?????? 1/2 1/16 tx clock rx clock ti ri tx shift rx start rx shift load sbuf smod clock sin d8 sbuf read sbuf internal data bus serial controllor clock load parin tx start internal data bus sbuf write to sout transmit shift register serial interrupt txd rxd parout rb8 start stop 0 1 bit detector 1-to-0 detector sample 1/16 0 timer 1 overflow 1 receive shift register ?? 1 15.3 ?? 2 ?? 11 ??????????0 8 ???? 9 ? tb8 ?? (0) 9 ? rb8 ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 43 2007.8.16 ?? 1/32 1/64 pcon smod ? sbuf ?? ?? ?? 16 ????? c1 ?? txd ??? 16 ?? ? c1 ? txd ??? 16 ??????? sbuf ? 9 ???????? txd ? ti c1 ?? sbuf ? 16 ??? 11 ?? ren=?1? ??? rxd ?? 1-0 ??? rxd 16 ?????? 16 ????0? ?????? 16 ???1 ??? 16 ???3 ???? 8 9 10 ? 3 ??? rxd ??? 3 2 ???????? rxd ??? rxd ? 0 ?????? 1-0 ? ?? 0 ???????? ? 1/2 1/16 tx clock rx clock ti ri tx shift rx start rx shift load sbuf smod clock sin d8 sbuf read sbuf internal data bus serial controllor clock load parin tx start internal data bus sbuf write to sout transmit shift register serial interrupt txd rxd parout rb8 start stop 0 1 bit detector 1-to-0 detector sample 1/16 0 fcpu clock/2 1 d8 tb8 receive shift register ?? 2 ? 9 ?????? rb8 ? ri ? ri ?1? ?? ? ri=0 sm2=0 ???? 1 ? ??? rb8 8 ? sbuf ri ??? ?????? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 44 2007.8.16 15.4 ?? 3 ??3 ?????? 2 ?????? sfr ? ???????? 1 ?? 3 ?? 1 ??? ?? sbuf ????? 0 ri=0 ren=1 ???? txd ???? rxd ? 8 ???? ren=1 ??? ???????? 1/2 1/16 tx clock rx clock ti ri tx shift rx start rx shift load sbuf smod clock sin d8 sbuf read sbuf internal data bus serial controllor clock load parin tx start internal data bus sbuf write to sout transmit shift register serial interrupt txd rxd parout rb8 start stop 0 1 bit detector 1-to-0 detector sample 1/16 0 1 d8 tb8 timer 1 overflow receive shift register ?? 3 ??? sm1 sm0 ?? ? ? ? ?? 9 0 0 0 ? 4 12 tclks 8 0 1 1 ? ?1 10 1 1 1 0 2 ? 32 64tclks 11 1 1 0, 1 1 1 3 ? ?1 11 1 1 0, 1 15.5 ? ??????????????? ?????? n79a82x1 ???????? ? scon.7 fe ?? fe_1 ?? 8051 ? sm0 n79a82x1 ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 45 2007.8.16 ??? sm0/fe ????? sm0 ?fe ? smod0 pcon.6 ? smod0=1 ? fe ? smod0=0 ?sm0 fe ??? 0 ?? fe ???? smod0 ? 1 fe ?????? . ??? pcon ? : 87h bit: 7 6 5 4 3 2 1 0 smod smod0 - por gf1 gf0 pd idl 7 smod 1: ??? 1 2 3 ??? . 6 smod 0 0: scon.7 ?? fe ??? 1: scon.7 ?? 8052 scon.7 ?. 15.6 ? ??? 2 ?? 3 ??? n79a82x1 ? ri ????? ??????????? ???? 9 1 ????????? ?????????? sm2 ???????? ??????????????????? ??? sm2 ????? sm2=0 ???? ??????????????? 1 ?? 1 ??? sm2=1 ??????? ri ? 1 ??? saddr ? : a9h bit: 7 6 5 4 3 2 1 0 saddr.7 saddr.6 saddr.5 saddr.4 saddr.3 saddr.2 saddr.1 saddr.0 7~0 saddr saddr ????????? ? ?? saden ? : b9h bit: 7 6 5 4 3 2 1 0 - - - - - - - - 7~0 saden ??? 0 ???? saden ?? 1 ? saddr ??????? saden.n ? 0 ???????? saden ?? 0 ????? ?? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 46 2007.8.16 ?????????????????? saddr saden ??? saddr ? 8 ? saden ? 0 saddr ??? saden ?? 1 saddr ? ?????????? ? 1: saddr 1010 0100 saden 1111 1010 given 1010 0x0x ? 2: saddr 1010 0111 saden 1111 1001 given 1010 0xx1 ?1 2 ??? ?? 1 ???? 2 ???? 2 ? ????? 1 ?? 1 ??????? 0=1 1=0 3 ???? ??????? saddr saden ????? 0 ???????? ffh ? 1 ??? 1111111x ? 2 ???? 11111111 saddr saden ??? a9h b9h 2 ??? 0 ???? ??????? ???? tmod&=0x00; tmod|=0x20; // ?1 ??? 2 th1 =0xfd; tl1=0xfd; //11.0592m ?? 9600 scon = 0x50; // ??? 1 ? pcon|=0x80; //smod ???? tr1=1; // ? 1 es=1; // ?? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 47 2007.8.16 16 ??? n79a82x1 ???I??? rom ?????? / y??????????? ????????? n79a82x1 ????? ????????? ?????????????? ????? 3 ? 3 ?????? ???? ta ? aah 55h ta ??? c7h ? ????? ta reg 0c7h ; c7h ?? ta mov ta, #0aah mov ta, #055h ta aah ???? 3 55h ; 3 ?? 55h, ????????? 3 ?????? ?????????? ???? 1 mov ta, #0aah 3 m/c ?: m/c = mov ta, #055h 3 m/c mov wdcon, #00h 3 m/c 2 mov ta, #0aah 3 m/c mov ta, #055h 3 m/c nop 1m/c setb ewt 2 m/c 3 mov ta, #0aah 3 m/c mov ta, #055h 3 m/c orl wdcon, #00000010b 3m/c free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 48 2007.8.16 4 mov ta, #0aah 3 m/c mov ta, #055h 3 m/c nop 1 m/c nop 1 m/c clr por 2 m/c 5 mov ta, #0aah 3 m/c nop 1 m/c mov ta, #055h 3 m/c setb ewt 2 m/c ?2 ?? 3 ?? 3 ???? ?????? 4 ? 4 ??? ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 49 2007.8.16 17 (kbi) n79a82x1 ????? 8 ????? n79a82x1 ? ???????? cpu ?????? p0 ???? p0 ????? kbi ??? kbi0 ~ kbi7 ?? kbi ????? ( 1 ) auxr1 ??? (kbf) ?1? ? kb ??0? ? kbi ? p0 ? p0.7 p0.6 p0.5 p0.4 p0.3 p0.2 p0.0 kbi.0 kbi.1 p0.1 kbi.2 kbi.3 kbi.4 kbi.5 kbi.6 kbi.7 ekb (f ro m ie 1 r e g i ster) kbf (kbiinterrupt) free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 50 2007.8.16 18 ?? n79a82x1 ? mcu ? 2 ??????? ???? ?1? ? ?0? ??????? ?? ?????? (cmp1 cmp2) ??? cinna, cinnb, cmpref ?? oen ?1? cmp1 cmp2 ?????? ????????? oen ?1? ??? (vref) ? 1.19v +/- 10%. - + cmf1 cmp1(p0.6) interrupt cn1 cp1 vref co1 oe1 change detect comparator1 (p0.4) cin1a (p0.3) cin1b (p0.5) cmpref - + cmf2 cmp2(p0.0) interrupt cn2 cp2 co2 oe2 change detect comparator2 (p0.2) cin2a (p0.1) cin2b cmp1 analog circuit cmp2 analog circuit vref ce1 ce2 enable cmp1 enable cmp2 en free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 51 2007.8.16 19 i/o ? n79a82x1 ? mcu 2 i/o ??p0 p1 i/o ??? 4 ? p1.5 ????? 1 ? rpd=0 p1.5 ?? n79a82x1 ? mcu ? 16 i/o i/o ?? i/o ?? pxm1.y pxm2.y ??? 0 0 ?? 0 1 ?? 1 0 ( ) 1 1 ? ???? config1 ? prhi ?????? ????? p1.5 ???? p2m1 ? ent0 ent1 ?? 0 ?? 1 ??? 0 ? 1 ?? n79a82x1 ??? i/o ??? p2m1 ? p(n)s ? ttl ??? n 0 1 2 p(n)s 1 ???????? 19.1 ????? mcu ???????? 8051 ???? ???????? ???? 3 k??? ?? 3 ? ? ? ? ? ? ? ? ? ? ? ? ?0? ? ?1? ?? ??????? ?0? ?1? ???? 2 cpu ???? ?????? ? ? ?????? ?1? ???? ?0??. ?? ?1? ? ? ? ???? ?0? ? ? ? ???? ???????? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 52 2007.8.16 portpi n 2cpu cl ock d elay in p u t d a ta p ortlatch data pp p n vdd strong very weak weak 19.2 ???? ???k ?? portpi n portlatch data n in p u t d a ta free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 53 2007.8.16 19.3 ??? ?? 2 ?????????? ? ? ? ? ? ? ? ???? ? ? ? ??? ? n79a82x1 ? mcu 3 ??? p1.2, p1.3, p1.5 ? p1.2 p1.3 ?? ????????? portpi n inputd ata portlatch data p n vdd 19.4 ??????? n79a82x1 ?? pxm1.y pxm2.y ???? ttl ?? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 54 2007.8.16 20 n79a82x1 ?? 3 ? config ? (config1) ??? ??? ???? 4mhz 20mhz ? fosc0 fosc1 00h 11h crystal oscillator external clock input 16 bits ripple counter divide-by-m (divm register) cpu clock power monitor reset power down 20.1 ??? fosc1, fosc0 = 11h ??? (xtal1) ???? ?? 0hz 20mhz ? ? (xtal2) n79a82x1 ? mcu ?????????? n79a82x1 ?? ?? p2m1 ? enclk ? xtal2/clk ?????? ????? 1/4 cpu ?????????? ?????????? 20.2 cpu ? ?? n79a82x1 ? cpu ?? divm ?? divm = 00h cpu ? 4cpu ? / ??? (fosc) ?? divm ?? n ? cpu ??? 2(dvim+1) cpu ? 4 512 ??? cpu ????? cpu ??? ??????? cpu (fcpu) ?? 21 ?? ??????? n79a82x1 ?? 2 ?????? ? 21.1 ? ?????????? pof (pcon.4) ?1? ?? ? pof ? 21.2 ?? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 55 2007.8.16 ?????????????? n79a82x1 ? 2 ??? bov ( 1.4) ? bov =0 ???? 3.8v bov = 1 ???? 2.5v ??????? vdd ???????? bo i (e nabl e b row noutd etect) b row nout detect ci rc u i t 0 1 bo f to r eset to b row nouti nterrupt bod ?? bod (auxr.6) bof (pcon.5) ?????? bof boi (auxr1.5) ?1? ??? ea (ie.7) ebo (ie.5) ?1?. ???? ?? vdd ?? 50mv/us ? 2mv/us free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 56 2007.8.16 22 (pwm) n79a82x1 ? 4 pwm ? pwm ? pwm0(p0.1) pwm1(p1.6) pwm2(p1.7) pwm3(p0.0) prhi ?1? pwm ?? ?1? prhi ?0? pwm ?? ?0? pwm ?1? pwm ?1? ??? n79a82x1 ?? 10- pwm ????? pwm ? cpu ?? fcpu = fosc ????? pwm ?? fpwm = fcpu / (pwmp+1), pwmp 10- ? pwmph.1 pwmph.0 pwmpl.7~pwmpl.0 pwmp ????? pwmruncf ?? 10- ? cf ? ?? pwmp ???????? ? pwm pwmp ? clrpwm 10- ? 000h cf ??? pwmrun ? pwm ??pw m ????? pwm0l pwm3l pwm0h pwm3h ? pwm ??? 10- ?? pwm ??? pwm ? pwmn ??? ?1? ? pwmn ??????? pwm ? thi = (pwmp ? pwmn+1) ????? 000h pwmn ???? 3ffh pwmn ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 57 2007.8.16 10-bits c ounter com pare regi ster c ounter r egi ster pw m0regi ster pw m run f cpu + - com pare regi ster pw m1regi ster + - com pare regi ster pw m2regi ster + - com pare regi ster pw m3regi ster + - pw m1i pw m2i pw m3i pw m0i pw m0b pw m1b pw m2b pw m3b 0 1 0 0 0 1 1 1 + - cf x x x x y y y y > > > > l oad pw m p regi ster bken brake c ontrol bl ock bpen bkch clrpw m cl ear c ounter bkps brake pi n (p 0 . 2) bkf 0 1 b rake flag e nable e xternal b ra k e p i n (bpen , bkch ) = ( 1,0) p0. 2=0 p0. 2=1 p0. 1 p1. 6 p1. 7 p0. 0 pw m0 pw m1 pw m2 pw m3 pin20 (p 0 . 1) pin3 (p 1 . 6) pin2 (p 1 . 7) pin1 (p 0 . 0) free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 58 2007.8.16 pwm ?? pwmcon1, pwmcon2, pwmcon3 ? pwm ? pwmpl(d9 h) 7~0 pwmp.7 ~pwmp.0 pwm 7~0 ? pwm ? pwmph(d1 h) 7~2 - 1~0 pwmp.9 ~pwmp.8 pwm 9~8 ? pwm 0 ? pwm0l(da h) 7~0 pwm0.7 ~pwm0.0 pwm 0 7~0 ? pwm 1 ? pwm1l(db h) 7~0 pwm1.7 ~pwm1.0 pwm 1 7~0 ? pwm 2 ? pwm2l(dd h) 7~0 pwm2.7 ~pwm2.0 pwm 2 7~0 ? pwm 3 ? pwm3l(de h) 7~0 pwm3.7 ~pwm3.0 pwm3 7~0 ? pwm 0 ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 59 2007.8.16 pwm0h(d2 h) 7~2 - 1~0 pwm0.9 ~pwm0.8 pwm0 9~8 ? pwm1 ? pwm1h(d3 h) 7~2 - 1~0 pwm1.9 ~pwm1.8 pwm 1 9~8 ? pwm2 ? pwm2h(d5 h) 7~2 - 1~0 pwm2.9 ~pwm2.8 pwm 2 9~8 ? pwm3 ? pwm3h(d6 h) 7~2 - 1~0 pwm3.9 ~pwm3.8 pwm3 9~8 ? pwm ?? 1 pwmcon1( dch) 7 pwmrun 0: pwm ? . 1: pwm . 6 load 0: pwmppwmn ???????? 1: ? pwmp pwmn ?????? pwmppwmn ???????? ?0? 5 cf 0: 10- ?? . 1: 10- ? ?0? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 60 2007.8.16 4 clrpwm 1: 10- pwm ? 000h. ??? 3 pwm3i 0: pwm3 1: pwm3 2 pwm2i 0: pwm2 1: pwm2 1 pwm1i 0: pwm1 1: pwm1 0 pwm0i 0: pwm0 1: pwm0 pwm ?? 2 pwmcon2( dfh) 7 bkch 6 bkps 0: p0.2=0 ? pwm 1: p0.2=1 ? pwm 5 bpen 4 bken 0: ???. 1: ??? 3 pwm3b 0: ? pwm3 ? 1: ? pwm3 ? 2 pwm2b 0: ? pwm2 ? 1: ? pwm2 ? 1 pwm1b 0: ? pwm1 ? 1: ? pwm1 ? 0 pwm0b 0: ? pwm0 ? 1: ? pwm0 ? ? bpen bkch ? 0 0 ????? bken 0 1 ??pwm (pwmrun=0) ? pwmnb ?pwm 1 0 ???????? pwm pwmrun bkf ? ?0?. 1 1 pwm ?? 3 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 61 2007.8.16 pwmcon3 (d7h) 7~1 - 0 bkf ????? . 0: pwm ? . 1: pwm ????? ?0? n79a82x1 ??? (p0.2) ?????? pwmcon2 ??? ???????? pwm pwmnb ??? bken ?1? ??? bpen bkch ? (bpen, bkch) = (0,0) ?? (bpen, bkch) = (0,1) pwm pwmrun ? pwm ??? pwmrun=0 pwm pwmnb ?pwm ? pwmrun = 1 pwm n79a82x1 ??? (p0.2) ? pwm ???????? (bkf) ???? pwm p0.2 ? bkps = 0 bkf(pwmcon3.0) ? ?1? pwnrun ? pwm ?????? pwm pwmnb ? ??? bkf(pwmcon3.0) ?? ?1? ?? ? pwmcon1.7 pwm ??????? ????????????? ????? pwm ???? pwm ??? ????? pwm ?? ???????? pwm ? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 62 2007.8.16 1. pwmn output=pwmnb 2. h/w set bkf=1 & pwmrun=0 3. s/w switch to s/w brake (bken,bpen,bkch)=(1,0,0) 4. set pwmn comparator output= pwmnb or a given pattern 1. clear 10-bit pwm counter clrpwm=1 2. reload pwmp& pwm registers 3. enable brake function (bken,bpen,bkch)=(1,1,0) 1. clear bkf pwm output=pwm comparator output 2. re-start pwm running by setting pwmrun=1; load bit=1 start end initialize pwm function 1. set pwm control regs 2. set pwm brake output pattern (pwmnb) 3. enable brake function (bken,bpen,bkch)=(1,1,0) pwm starts running brake occurs? yes no brake pin is asserted? no yes void pwm(void) // pwm ? pwm0 ? { pwmcon1 |= 0x40; // ????? pwmph = 0x03; // ???? 0x3ff pwmpl = 0xff; pwm0h = 0x01; // ????? pwm0l = 0xff; pwmcon1 |= 0x80; // pwm while(1); } 23 ?? n79a82x1 ?? adc dac ?????? dac ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 63 2007.8.16 ????? (vdac) ???? (vin) (vdac) ?? ? adccon ? adcs ??1? ???? adcs ?? ? ? adc ? adccex ?1? adc adccon.5 (adcex) =0 ?? ??? adccon.3 (adcs) ?1? ?? adc ? adccon.5 =1 ?? ??? adccon.3 (adcs) ?1? stadc ??? adc ?? stadc ? ?? adc ??????????????? stadc ??????????????? . adccon.4 (adci) ?1?? 10- ???? 8 ??? adch ?? adccon.7 (adc.1) adccon.6 (adc.0) ??adccon ? 8- adc ? ( 8 adch ) ????k 50 ?adc ? adcs ??? ?1? 50 ???0? ad ccon.0 adccon.1 4 ?1 ???? adc ?M??? ?????? adci = ? 1 adc ????? ?? (adci = ? 1) ???? dac msb ls b s uccessive a pproxi mati on regi ster vi n + - c om parator start ready (s to p ) s uccessi ve approxi mati on c ontrollogi c v dac ?? adc free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 64 2007.8.16 23.1 adc ?? ?? adc ??? (avdd and avss ) ?? (vref+) ? dac ?? y?? 1023 ???? avss ? 0.5xr ? vref+ 0.5xr ? 1024xr ?y?? dac ?? ?? 1 : 7 6 5 4 3 2 1 0 kbf bod boi lpbov srst adcen 0 dps ? : auxr1 ?: a2h 2 adcen 0: ? adc . 1: adc . : 7 6 5 4 3 2 1 0 ea eadc ebo es et1 ex1 et0 ex0 ? : ie ?: a8h 6 eadc adc . adc ?? : 7 6 5 4 3 2 1 0 adc.1 adc.0 adcex adci adcs rcclk aadr1 aadr0 ?: adccon ?: e1h 7 adc.1 adc ? 1 6 adc.0 adc ? 0 5 adcex =?0? ? adcs ?1? ??adc ? =?1? adcs ?1?? stadc 1.4 ???? adc ? 4 adci adc ?? adc ???? adci ? ?1? adc ???? adc ???? ?0? ? ?0? ?1? ????1? ??? adc ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 65 2007.8.16 3 adcs adc ???? adcs ?1? ?? adc ?? stadc ? ?1? adc ?? adcs=?1? ? adci adcs=?0? adcs=?1? adci =?1? ??? adc ? adci adcs adc ?? 0 0 1 1 0 1 0 1 adc ???? adc ?? ????? adci=0 ????? adci=0 adci=0 ? adcs=1 ????? a/d ?? ?? adci=0 adcs=1 2 rcclk 0: cpu ?? adc ? . 1: ? rc ?? adc ? . 1 aadr1 ? 0 aadr0 ? aadr1, aadr0: adc ?? : adc ??? adci=0 adcs=0 ???? aadr1 aadr0 ?? 0 0 ad0 (p0.3) 0 1 ad1 (p0.4) 1 0 ad2 (p0.5) 1 1 ad3 (p0.6) adc ?? : 7 6 5 4 3 2 1 0 adc.9 adc.8 adc.7 adc. 6 adc.5 adc.4 adc.3 adc.2 ?: adch ?: e2h 7~0 adc.9 ~adc.2 adc ? auxr1.2 adcen =1 adc ? auxr1.2 adcen =0 ? adc ? void enableadc() { auxr1|=0x04; // adc ? adc ? ? } void disableadc() { auxr1&=0xfb;// ?adc ? adc ? ?? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 66 2007.8.16 } void adc_select(unsigned char adc_c) { switch(adc_c) { case 0:p0m1|=0x08;p0m2&=0xf7;adccon=0;break; case 1:p0m1|=0x10;p0m2&= 0xef;adccon=1; break; case 2:p0m1|=0x20;p0m2&= 0xdf;adccon=2; break; case 3:p0m1|=0x40;p0m2&= 0xbf;adccon=4; break; default: break; } } a-d ? (1) adccon.5(adcex)=0 adccon.3(adcs) ?1? ???a-d ?? void startadc() { adccon|=0x08; } (2) adccon.5(adcex)=0stadc(p1.4) ? , ??? a-d ? adc (1) adc ? void enableadc_int() { eadc=1; ea=1; } (2) adc ? void adc_isr() interrupt 11 { // } free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 67 2007.8.16 ? avss [(vref+) + ? lsb] ?? 10- adc 00 0000 0000 b = 000h ? [(vref+) ? 3/2 lsb] vref+ ?? 10- adc 11 1111 1111b = 3ffh avref+ avss avdd + 0.2v avss ? 0.2 v ??avref+ ?? avss ??? (vin) ? avref+ avss?? ?? result = avref vin 1024 ? ? result = vss vdd 1024 ? 10-bi ts adc bl ock adc0(p0.3) ad c [9:0] adci adcs vdd vref+ vss a a d r [1 :0 ] anal og input mul ti pl exer 0 1 p1.4 adcex adcclk adc bl ock d aigram adc conversi on b lock adcen adc1(p0.4) adc2(p0.5) adc3(p0.6) avss avdd rc_clk 1 0 rcclk adc ? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 68 2007.8.16 24 i2c 2 (sda scl)i2c ? 2 ???? 2007. ???? 2007. ? ( ?? ) 2007. ??????? 2007. ??????????? 2007. ?????? 2007. i2c ??? n79a82x1 ?? i2c ????? i2c ????? ( ? ?) i2c ????????? (i2sta) ?i2c ??? cpu i2c ??? 4 ??? : i2con (sio1 ?? ), i2sta (sio1 ??? ), i2dat (sio1 ?? ), i2adr (sio1 ??? ) sio1 ?? i2c ???? p1 ? p1.2/scl ( ? ) p1.3/sda ( ) 24.1 sio1 ? sio1 ??i/o ??? i2c ??? sio1 ????i2con ens1 ?1? ??? cpu sio1 ?????6 ??? i2con (i2c ?, c0h), i2status ( ??? , bdh), i2dat ( ?? , bch), i2addr ( ?? , c1h), i2clk ( ??? beh) i2 ? ( ?? , bfh). sio1 i2c ??? 2 ? sda (p1.3, ) scl (p1.2, ? ) sio1 p1.2 p1.3 ? 1 24.2 i2c ?? : n79a82x1 ???? i2c ?? 24.2.1 ?? , i2addr sio1 ??i2addr cpu ?? 8- ? 8- ?????? ??? sio1 ?????????? ?sio1 ????? : 7 6 5 4 3 2 1 0 i2addr.7 i2addr.6 i2 addr.5 i2addr .4 i2addr. 3 i2addr.2 i2addr. 1 gc ? : i2addr ?: c1h free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 69 2007.8.16 24.2.2 ?? , i2dat ??????????????? cpu ? 8- ?????? sio1 ?????? (si) ?1? ?? si=?1? i2dat ??????????? i2dat ??????????????? i2dat ? : 7 6 5 4 3 2 1 0 i2dat.7 i2dat.6 i2dat.5 i2dat.4 i2dat.3 i2dat.2 i2dat.1 i2dat.0 ? : i2dat ?: bch ? i2dat ? 9- ? sio1 ?? cpu ?? i2dat ? ??? scl ?????? i2dati2dat ? ???? (ack nack)? 9 ?????? (scl ?) i2dat ?? (scl ? ) ? i2dat 24.2.3 ?? , i2con cpu ?? 8- ?????? si sio1 ??? sto ?? si? ?1? ens1 = ?0? ?sto : 7 6 5 4 3 2 1 0 - ens1 sta sto si aa - - ?: i2con ?: c0 7 - . 6 ens1 0: ?i2c ? sda scl ??? sda scl ??? i2c ?????? i2con sto ?? ?0? ?? p1.0(scl) p1.1(sda) ?? i/o 1: i2c ? p1.0 p1.1 ??? 1 ?? 5 sta ??. 0:sta ????? 1:sta ?1? i2c ???? i2c ? i2c ?? ??? i2c ?stop ? i2c ? ?????? sta ?1?i2c ??? ??? sta ?1? sta ?i2c ??????? ?1? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 70 2007.8.16 4 sto i2c ???? sto ?1? i2c stop ?? stop i2c ? sto ????? sto ? ?1? ?? ???? stop ? i2c ?? i2c ? stop ???????? sto ??? i2c ?? ( ???? i2c ?? stop ? ) sta sto ?? ?1?stop ? i2c ? i2c ?? 3 si 0: si ??????? scl ???? 1: si ???1? ?0? eaes ( ie ?) ?1? ???? si?1? scl ???????? ???????????? si?? 2 aa ?? 0: ?? scl ?? (sda ??? ) 1) sio1 ? ????? 2) sio1 ????????? ? 1: ?? scl ?? (sda ??? ) 1) ?? ?? 2) sio1 ?????? 3) sio1 ?????? ???? 1 - . 0 - . 24.2.4 i2c ?? , i2clk sio1 ??i2c ?? i2clk ????????????? sio1 ?i2c ????? 400 khz i2c ??? i2c ? = fcpu / (i2clk+1) fcpu=fosc/4 fosc = 16mhz i2clk = 40(28h) i2c ? i2c = 16mhz /(4x (40 +1)) = 97.56k / ??? : 7 6 5 4 3 2 1 0 i2clk.7 i2clk.6 i2clk.5 i2clk.4 i2clk.3 i2clk.2 i2clk.1 i2clk.0 ? : i2clk ?: beh 7 ~ 0 i2clk ?? . free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 71 2007.8.16 1 0 fosc 1/4 14-bits counter tif clear counter enti si div4 ens1 to i2c interrupt enable si 24.2.5 ??? , i2status i2status ? 8- ?? 3 ??? 0 ??? 23 ???? i2status f8h ??? i2status ??? sio1 ???? ????? (si = 1) si ??1? 1 ? si ? ?? i2status ? 00h ????? start stop ???? ??????????? 24.3 i2c ?? ? 4 ??? / ? / ?? / ?? / ? i2con sta sto aasi sio1 ????? i2status ?2?? si? ?1? ??( si ) ?????? / ?? a. ???sta b. ????? 7 +w 1 ?? ack ?? c. ?????????? ack ?? d. ????? sto ? flash ?????? b ??????? ? ? i2con = 0xe4; // sta,ack while(!si) _nop_(); // ? ack i2data = slave_address+1; // ??+ i2con = 0xc4; // ack while(!si) _nop_(); i2data = send_data; // ? while(!si) _nop_(); i2con = 0xd4; // , sto / ?? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 72 2007.8.16 ??? a ??? sta b ????? 7 +r 0 ?? ack ?? c ????????? ack ?? d ????? sto ? i2con = 0xe4; // sta ack while(!si) _nop_(); // ? ack i2data = slave_address+0; // ?? + i2con = 0xc4; // ack while(!si) _nop_(); receive_data = i2data; // ??? while(!si) _nop_(); i2con = 0xd4; // , sto ??????? : a ??? sta b ????? 7 +w 1 ?? ack ?? c ???????? ack ?? d ?????? sta e ????? 7 +r 0 ?? ack ?? f ?????????ack ?? g ???? sto ? i2con = 0xe4; // sta ack while(!si) _nop_(); // ? ack i2data = slave_address+1; // ?? + i2con = 0xc4; // ack while(!si) _nop_(); // ?ack i2data = memory_address; // ?? i2con = 0xc4; // ack while(!si) _nop_(); // ? ack i2con = 0xe4; // i2data = slave_address+0; // ?? + i2con = 0xc4; // ack while(!si) _nop_(); // ? ack receive_data = i2data; // ??? while(!si) _nop_(); i2con = 0xd4; // , sto ?/ ?? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 73 2007.8.16 a ?????? i2addr ?? b ?????????????? ack c ? +ack d ???? ? i2addr = slaveown_address;// ???? i2con = 0xc4; // ack while(!si) _nop_(); // ?? i2data = send_data; // i2con = 0xc4; // ack while(!si) _nop_(); ?/ ?? a ?????? i2addr ?? b ?????????????? ack c ??? +r 0 d ???? ack e ???? ? i2addr = slaveown_address;// ???? i2con = 0xc4; // ack while(!si) _nop_(); // ?? i2data = slaown_address+0;// ??? + i2con = 0xc4; // ack while(!si) _nop_(); // ? ack re ceive_data = i2data; // ? i2con = 0xc4; // ack while(!si) _nop_(); ?????? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 74 2007.8.16 08h a s ta r t has been transm i tte d . (s t a ,s t o ,s i,a a )= (0 ,0 ,0 ,x ) sla+w wi l lbe transm itted; ack bi tw i l lbe received. 18h s la +w has been transm itted; a c k has been received. laststate lastaction i sdone n extsetti ng i ns1con e xpected nextacti on nextaction i sdone n e w s ta te software' s a c c e s s to s 1 d a t w ith re s p e c t to "e x p e c te d n e x t a c ti on": s oftw are should load the data byte (to be transm i tte d ) i nto s 1d a t before new s 1c o n setting is done. (1 ) d a ta b y te w i ll b e tra n s m itte d : (2 ) s l a + w (r ) w i ll be transm itted: s oftw are should load the s la +w /r (to be transm i tte d ) i nto s 1d a t before new s 1c o n setting is done. (3 ) d a ta b y te w i ll b e re c e i ved: s oftw are can read the received data byte from s 1d a t whi l e a new state i s entered. free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 75 2007.8.16 24.3.1 ?? 08 h a start has been transmitted . (sta ,sto ,si, aa)=(0 ,0, 0,x ) sla +w will be transmitted ; ack bit will be received . set sta to generate a start . 18 h sla +w will be transmitted ; ack bit will be received . or 20 h sla +w will be transmitted ; not ack bit will be received . (sta ,sto ,si ,aa )=( 1, 0,0 ,x) a repeated start will be transmitted ; (sta,sto,si,aa)=(0,0,0,x) data byte will be transmitted ; ack will be received . (sta ,sto,si ,aa )=( 0, 1,0 ,x) a stop will be transmitted ; sto flag will be reset . send a stop (sta ,sto ,si, aa)=( 1 ,1, 0,x ) a stop followed by a start will be transmitted ; sto flag will be reset . send a stop followed by a start 28h data byte in s 1dat has been transmitted ; ack has been received . or 30h data byte in s 1dat has been transmitted ; not ack has been received . 10 h a repeated start has been transmitted . (sta,sto ,si ,aa)=(0 ,0 ,0, x) sla + r will be transmitted ; ack bit will be transmitted ; sio 1 will be switched to mst /rec mode . 38 h arbitration lost in sla +r/w or data byte . (sta ,sto ,si, aa)=(0 ,0, 0,x ) i2c bus will be release ; not address slv mode will be entered . (sta ,sto ,si, aa)=( 1 ,0, 0,x ) a start will be transmitted when the bus becomes free . send a start when bus becomes free enter naslave from slave mode (c) to master /receiver (a) from master /receiver (b) free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 76 2007.8.16 24.3.2 ?? 08 h a start has been transmitted . (sta ,sto ,si, aa)=(0 ,0, 0,x ) sla +r will be transmitted ; ack bit will be received . set sta to generate a start . 40 h sla + r has been transmitted ; ack has been received . (sta ,sto ,si, aa)=( 0 ,1 ,0,x ) a stop will be transmitted ; sto flag will be reset . (sta ,sto ,si ,aa )=(1, 1,0 ,x) a stop followed by a start will be transmitted ; sto flag will be reset . (sta ,sto ,si ,aa )=( 0, 0,0 ,0) data byte will be received ; not ack will be returned . send a stop (sta ,sto , si,aa )=(0 ,0,0 ,1 ) data byte will be received ; ack will be returned . 10 h a repeated start has been transmitted . (sta ,sto ,si ,aa )=(0,0 ,0, x) sla + r will be transmitted ; ack bit will be transmitted ; sio 1 will be switched to mst /rec mode . (sta , sto ,si ,aa )=( 1,0 ,0 ,x) a start will be transmitted ; when the bus becomes free (sta , sto ,si ,aa )=( 0, 0,0 ,x) i2 c bus will be release ; not address slv mode will be entered . enter naslave from master /transmitter (a) to master /transmitter (b) from slave mode (c) 48h sla +r has been transmitted ; not ack has been received . 58 h data byte has been received ; not ack has been returned . 50h data byte has been received ; ack has been returned . send a stop followed by a start 38 h arbitration lost in not ack bit . send a start when bus becomes free (sta ,sto , si,aa )=( 1, 0,0 ,x) a repeated start will be transmitted ; free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 77 2007.8.16 24.3.3 ??? set aa a8 h own sla +r has been received ; ack has been return . or b0 h arbitration lost sla +r/w as master ; own sla +r has been received ; ack has been return . (sta,sto ,si ,aa)=(1 ,0 ,0,1 ) switch to not address slv mode ; own sla will be recognized ; a start will be transmitted when the bus becomes free . (sta ,sto,si,aa )=(0, 0,0 ,0) last data will be transmitted ; ack will be received . (sta ,sto, si,aa )=(0 ,0,0,1) data byte will be transmitted ; ack will be received . send a start when bus becomes free c8h last data byte in s 1dat has been transmitted ; ack has been received . (sta,sto ,si ,aa)=(1,0,0, 0) switch to not addressed slv mode ; no recognition of own sla ; a start will be transmitted when the becomes free. (sta ,sto ,si, aa)=(0 ,0, 0,1 ) switch to not addressed slv mode ; own sla will be recognized . (sta ,sto,si ,aa )=(0, 0,0,0) switch to not addressed slv mode ; no recognition of own sla . enter naslave to master mode (c) (sta, sto,si ,aa )=(0,0 ,0 ,0) last data byte will be transmitted ; ack will be received . (sta,sto ,si ,aa)=(0,0,0,1) data byte will be transmitted ; ack will be received . c0h data byte or last data byte in s 1dat has been transmitted ; not ack has been received . b8h data byte in s 1dat has been transmitted ; ack has been received . a0 h a stop or repeated start has been received while still addressed as slv /rec. free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 78 2007.8.16 24.3.4 ??? set aa 60h own sla+w has been received ; ack has been return . or 68h arbitration lost sla +r/w as master ; own sla+w has been received ; ack has been return . (sta ,sto, si,aa )=(1 ,0,0 ,1 ) switch to not address slv mode ; own sla will be recognized ; a start will be transmitted when the bus becomes free . (sta, sto,si,aa)=(0,0,0,0) data will be received ; not ack will be returned . (sta ,sto,si,aa)=(0,0,0,1) data will be received ; ack will be returned . send a start when bus becomes free 88h previously addressed with own sla address ; not ack has been returned . (sta ,sto ,si, aa)=(1 ,0, 0,0) switch to not addressed slv mode ; no recognition of own sla ; a start will be transmitted when the becomes free . (sta ,sto,si,aa)=(0,0,0,1) switch to not addressed slv mode ; own sla will be recognized . (sta,sto ,si,aa)=(0,0,0,0) switch to not addressed slv mode ; no recognition of own sla . enter naslave to master mode (c) (sta,sto ,si,aa)=(0,0 ,0, 0) data byte will be received ; not ack will be returned . (sta ,sto,si,aa )=(0, 0,0 ,1) data byte will be received ; ack will be returned . 80h previously addressed with own sla address ; data has been received ; ack has been returned . a0h a stop or repeated start has been received while still addressed as slv / rec. free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 79 2007.8.16 24.3.5 gc ?? set aa 70h reception of the general call address and one or more data bytes ; ack has been return . or 78h arbitration lost sla +r /w as master ; and address as sla by general call ; ack has been return . (sta ,sto, si,aa )=( 1 ,0,0 ,1 ) switch to not address slv mode ; own sla will be recognized ; a start will be transmitted when the bus becomes free . (sta, sto ,si ,aa )=( x,0 ,0, 0) data will be received ; not ack will be returned . (sta ,sto ,si ,aa )=( x,0 ,0 ,1) data will be received ; ack will be returned . send a start when bus becomes free 98h previously addressed with general call ; data byte has been received ; not ack has been returned . (sta ,sto ,si, aa)=( 1 ,0, 0,0 ) switch to not addressed slv mode ; no recognition of own sla ; a start will be transmitted when the becomes free . (sta ,sto,si ,aa )=( 0, 0,0 ,1) switch to not addressed slv mode ; own sla will be recognized . (sta,sto ,si ,aa)=( 0 ,0 ,0, 0) switch to not addressed slv mode ; no recognition of own sla . enter naslave to master mode (c) (sta,sto ,si ,aa )=(x,0,0,0 ) data byte will be received ; not ack will be returned . (sta ,sto,si ,aa )=( x,0 ,0 ,1) data byte will be received ; ack will be returned . 90h previously addressed with general call ; data has been received ; ack has been returned . a0h a stop or repeated start has been received while still addressed as slv /rec . free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 80 2007.8.16 25 icp( ? ) flash ? n79a82x1 ??????????? icp( ? ) ??? ? icp ?????? p1.5 p0.4 p0.5 ? icp ??? ?icp ??? ( ? ~10.5v) ??????? ??p1.5 ????? icp ???????? ?? ?icp ??????? ?1? ? n79a82x1 ?? flash eprom ???? 16k/8k/4k/2k ?? ap flash eprom 256/128 ? nvm ? icp ????? ap flash eprom ? 256/128 ?? nvm ? w79e82x chip p1.5 p0.4 p0.5 vdd vss to i/o pin to i/o pin to reset or input pin vss vdd vpp data clock vss icp program tool vcc jumper icp connector system board icp power jumper ?: 1 ?p1.5, p0.4 p0.5 ???? 2 icp ???????? icp ????? 3 ????k? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 81 2007.8.16 26 n79a82x1 ? 2 (config1 config2) 2 ????? ?????? 2 flash eprom ?? 2 flash eprom ? ??????? 2 ??? movc ? ???? 26.1 config1 ?1 1 : 76 54321 0 w d t e : w d t ??? r p d : ?? p r h i: ????? b o v : ??? f osc1: c p u ?1 f osc0: c p u ?0 rpd w dte prhi bo v - fosc0 f osc1 - - 7 wdte ????? : 0: 1: cpu ?????? 6 rpd ?? : 0: p1.5 ?? . 1: ?p1.5 ???? 5 prhi ????? : 0: ?????? . 1: ?????? . 4 bov ???? : 0: ???? 3.8v. 1: ???? 2.5v. 3 - . 2 - . 1 fosc1 cpu ? 1 0 fosc0 cpu ? 0 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 82 2007.8.16 : fosc1 fosc0 0 0 4mhz ~ 20mhz 0 1 1 0 1 1 ?? 26.2 config2 ?2 2 : 76 54321 0 c7: 8k /4k /2k f l ash e p r o m c6: 256 ?? c6 c7 - -- - -- c7: 16k/8k/4k/2k?flash eprom ? n79a82x1 ? ?????? ?0 ?? flash eprom ??? c6: 256/128 ? flash eprom ? n79a82x1 ? 256/128 ?????? ?? 0 ???? flash eprom ??? 7 6 1 1 16k/8k/4k/2k ?? 256/128 ???? icp 0 1 16k/8k/4k/2k ???icp ?? 256/128 ? ???? 1 0 ? 0 0 16k/8k/4k/2k ?? 256/128 ???? icp ? 27 ??? ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 83 2007.8.16 ? 0 : 7 6 5 4 3 2 1 0 p0.7 p0.6 p0.5 p0.4 p0.3 p0.2 p0.1 p0.0 ?: p0 ?: 80h ?0 ??? i/o ? ?? : 7 6 5 4 3 2 1 0 sp.7 sp.6 sp.5 sp.4 sp.3 sp.2 sp.1 sp.0 ?: sp ?: 81h ??? ram ?????? ?? : 7 6 5 4 3 2 1 0 dpl.7 dpl.6 dpl.5 dpl.4 dpl.3 dpl.2 dpl.1 dpl.0 ?: dpl ?: 82h 16 ???? ?? : 7 6 5 4 3 2 1 0 dph.7 dph.6 dph.5 dph.4 dph.3 dph.2 dph.1 dph.0 ? : dph ?: 83h 16 ??? ? : 7 6 5 4 3 2 1 0 smod smod0 bof por gf1 gf0 pd idl ?: pcon ?: 87h free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 84 2007.8.16 7 smod 1 ??? 1 2 3 ??? 6 smod0 0: scon.7 ?? fe ??? 1: scon.7 ?? 8052 scon.7 ?. 5 bof 0: 1: ?y???? 4 por 0: ? 1: ?y?? 3 gf1 ???? 2 gf0 ???? 1 pd 1 ??????????? 0 idl 1 ?????? cpu ?????? ??????? ? : 7 6 5 4 3 2 1 0 tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 ?: tcon ?: 88h 7 tf1 ?1 ??? 1 ? 1 ?? 1 ?? ?? 0 ????? 6 tr1 ?1 ????? 5 tf0 ?0 ??? 1 ? 1 ?? 0 ?? ?? 0 ????? 4 tr0 ?0 ????? 3 ie1 ? 1 ? 1int ????? 1 ??? ? ie1 ?? 0 . 2 it1 1 ?? 1 ??? 0 ?? 1 ie0 ? 0 ? 0 int ????? 1 ??? ? ie0 ?? 0 0 it0 ? 0 ?? 1 ??? 0 ?? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 85 2007.8.16 ??? : 7 6 5 4 3 2 1 0 gate tc/ m1 m0 gate tc/ m1 m0 ?: tmod ?: 89h 7 gate ?? 1 ?, ?/ trx ? n int ? trx n int ? 1 ?? / ?? 0 ??? trx ? 6 tc/ ?/ ??? 0 ?????? 1 ? tx ???? ? 5 m1 ??? 4 m0 ??? 3 gate ?? 1 ?, ?/ trx ? n int ? trx n int ? 1 ?? / ?? 0 ??? trx ? 2 tc/ ?/ ??? 0 ?????? 1 ? tx ???? ? 1 m1 ??? 0 m0 ??? m1, m0: ???: m1 m0 ?? 0 0 ?? 0: 8- ? 5 ?? 0 1 ?? 1: 16- ?? 5 ?? 1 0 ?? 2: 8 thx ??? 1 1 ??3: t0 tl0 ?? 0 ?8 ? / th0 ?? 1 ? 8 ? / ? 1 ???2 ? 0 ? : 7 6 5 4 3 2 1 0 tl0.7 tl0.6 tl0.5 tl0.4 tl0.3 tl0.2 tl0.1 tl0.0 ?: tl0 ?: 8ah tl0.7-0: ? 0 ? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 86 2007.8.16 ? 1 ? : 7 6 5 4 3 2 1 0 tl1.7 tl1.6 tl1.5 tl1.4 tl1.3 tl1.2 tl1.1 tl1.0 ?: tl1 ?: 8bh tl1.7-0: ? 1 ? ? 0 ? : 7 6 5 4 3 2 1 0 th0.7 th0.6 th0.5 th0.4 th0.3 th0.2 th0.1 th0.0 ?: th0 ?: 8ch th0.7-0: ? 0 ? ? 1 ? : 7 6 5 4 3 2 1 0 th1.7 th1.6 th1.5 th1.4 th1.3 th1.2 th1.1 th1.0 ?: th1 ?: 8dh th1.7-0: ? 1 ? ?? : 7 6 5 4 3 2 1 0 - - - t1m t0m - - - ? : ckcon ?: 8eh 7~5 4 t1m ?1 ?? 0: ?1 ??? 1/12 ???? 1: ?1 ??? 1/4 ???? 3 t0m ? 0 ?? : 0: ? 0 ??? 1/12 ???? 1: ? 0 ??? 1/4 ???? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 87 2007.8.16 2~0 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 88 2007.8.16 ? 1 : 7 6 5 4 3 2 1 0 p1.7 p1.6 p1.5 p1.4 p1.3 p1.2 p1.1 p1.0 ?: p1 ?: 90h p1.7 ? 0 ? / ??????? - ? - ? ???? 7 p1.7 pwm2 6 p1.6 pwm 1 5 p1.5 rst ?? 4 p1.4 int1 3 p1.3 int0 ? i 2 c sda 2 p1.2 ?0 i 2 c scl 1 p1.1 ? rxd 0 p1.0 ? txd ?? : 7 6 5 4 3 2 1 0 divm.7 divm.6 divm.5 divm.4 divm.3 divm.2 divm.1 divm.0 ?: divm ?: 95h divm ? uc ????? ? : 7 6 5 4 3 2 1 0 sm0/fe sm1 sm2 ren tb8 rb8 ti ri ?: scon ?: 98h free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 89 2007.8.16 7 sm0/fe 0 ?? 0 ? pcon ??? smod0 ?? sm0 ?????? ??? 6 sm1 ?? 1 sm0 sm1 ?? ? ? 0 0 0 ? 8 ??4 12 ?? 0 1 1 ? 10 ? 1 0 2 ? 11 ??64 32 ?? 1 1 3 ? 11 ? 5 sm2 ??? 1 ??? 2 ?? 3 ?????? 2 3 sm2 1 ???? rb8 0 ? ri ?? 1 sm2 1 ?????? ri ???? 0 sm2 ???? 0 ??????? 12 ??? ? 8052 ? 1 ??????? 4 ???? ??? 4 ren ?? 1 ???????? 3 tb8 ??2 3 ???????? 1 0 2 rb8 ??2 3 ?????? 1 sm2=0 rb8 ?????? 0 ? 1 ti ???? 0 ????? 8 ???? ??????? 0 ri ???? 0 ?????? 8 ???? ?????? ? : 7 6 5 4 3 2 1 0 sbuf.7 sbuf.6 sbuf.5 sbuf.4 sbuf.3 sbuf.2 sbuf.1 sbuf.0 ?: sbuf ?: 99h 7~0 sbuf ????????? 2 8 ? ???????? ? : 7 6 5 4 3 2 1 0 kbi.7 kbi.6 kbi.5 kbi.4 kbi.3 kbi.2 kbi.1 kbi.0 ?: kbi ?: a1h free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 90 2007.8.16 . 7 kbi.7 1: p0.7 . 6 kbi.6 1: p0.6 . 5 kbi.5 1: p0.5 . 4 kbi.4 1: p0.4 . 3 kbi.3 1: p0.3 . 2 kbi.2 1: p0.2 . 1 kbi.1 1: p0.1 . 0 kbi.0 1: p0.0 . ?? 1 : 7 6 5 4 3 2 1 0 kbf bod boi lpbov srst adcen 0 dps ? : auxr1 ?: a2h free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 91 2007.8.16 7 kbf ?? : 1: ???????????? ?0?. 6 bod ??: 0: ??? . 1: ??????? . 5 boi ??: 0: ???? . 1: ?????? . 4 lpbov ??? : 0: bod ????????????? ? 1: bod ? mcu ?? bod ? rc (2mhz~0.5mhz) 1/16 ??????? 3 srst : 1: ??? 2 adcen 0: ? adc . 1: adc . 1 0 0 dps dual ? ? 0: ?? 8051 dptr. 1: ? dptr1 : 7 6 5 4 3 2 1 0 ea eadc ebo es et1 ex1 et0 ex0 ?: ie ?: a8h free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 92 2007.8.16 7 ea ? . / ?? . 6 eadc adc . 5 ebo ?? . 4 es ?? . 3 et1 ?? 1 . 2 ex1 ? 1. 1 et0 ?? 0 . 0 ex0 ? 0. ?? : 7 6 5 4 3 2 1 0 saddr.7 saddr.6 saddr.5 saddr.4 saddr.3 saddr.2 saddr.1 saddr.0 ?: saddr ?: a9h 7 saddr saddr ????????? ? 1 ?? : 7 6 5 4 3 2 1 0 - - ce1 cp1 cn1 oe1 co1 cmf1 ? : cmp1 ? : ach free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 93 2007.8.16 7 - 6 - 5 ce1 ? : 0: ?? 1: ? ce1 ? 1 ? 10us ??? 4 cp1 ?? : 0: ? cin1a ??? 1: ? cin1b ??? 3 cn1 ?? : 0: ?cmpref ?????? 1: ?vref ?????? 2 oe1 : 1: ? (ce1 = 1) ?? cmp1 ? cpu ? ? 1 co1 ? : cpu ????? (ce1 = 0) ? 0 cmf1 ??? : ?? co1 ???????? mcu ?????? (ce1 = 0) ? ? 2 ?? : 7 6 5 4 3 2 1 0 - - ce2 cp2 cn2 oe2 co2 cmf2 ? : cmp2 ?: adh 7 - 6 - 5 ce2 ? : 0: ?? 1: ? ce2 ? 1 ? 10us ??? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 94 2007.8.16 4 cp2 ? ?: 0: ? cin2a ??? 1: ? cin2b ??? 3 cn2 ? ?: 0: ?cmpref ?????? 1: ?vref ?????? 2 oe2 : 1: ? (ce2 = 1) ?? cmp2 ? cpu ?? 1 co2 ? : cpu ????? (ce2 = 0) ? 0 cmf2 ? ?: ?? co2 ???????? mcu ?????? (ce2 = 0) ? ? 0 ?? 1 : 7 6 5 4 3 2 1 0 p0m1.7 p0m1.6 p0m1.5 p0m1 .4 p0m1.3 p0m1.2 p0m1.1 p0m1.0 ?: p0m1 ?: b1h ? 0 ?? 2 : 7 6 5 4 3 2 1 0 p0m2.7 p0m2.6 p0m2.5 p0m2 .4 p0m2.3 p0m2.2 p0m2.1 p0m2.0 ?: p0m2 ?: b2h ? 1 ?? 1 : 7 6 5 4 3 2 1 0 p1m1.7 p1m1.6 - p1m1.4 - - p1m1.1 p1m1.0 ?: p1m1 ?: b3h ? 1 ?? 2 : 7 6 5 4 3 2 1 0 p1m2.7 p1m2.6 - p1m2.4 - - p1m2.1 p1m2.0 ?: p1m2 ?: b4h free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 95 2007.8.16 ? - ?? 3 : 7 6 5 4 3 2 1 0 - p1s p0s - t1oe t0oe - - ?: p2m1 ?: b5h 7 - 6 p1s =1: p1 ???? 5 p0s =1: p0 ???? 4 enclk =1; ??? xtal2 ? . 3 t1oe =1: ? 1 ?p0.7 ?? p0.7 ???? 1 ???? 2 t0oe =1: ? 0 ?p1.2 ?? p1.2 ???? 0 ???? 1 - 0 - ?? : 7 6 5 4 3 2 1 0 - padch pboh psh pt1h px1h pt0h px0h ?: ip0h ?: b7h 7 - ?? 6 padch 1: adc ??? 5 pboh 1: ????? 4 psh 1: ?? 0 ??? 3 pt1h 1: ?? 1 ??? 2 px1h 1: ? 1 ?? 1 pt0h 1: ?? 0 ?? 0 px0h 1: ? 0 ?? ? 0 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 96 2007.8.16 : 7 6 5 4 3 2 1 0 - padc pbo ps pt1 px1 pt0 px0 ?: ip0 ?: b8h 7 - ???? ?1?. 6 padc 1: adc ???? . 5 pbo 1: ?????? . 4 ps 1: ?????? . 3 pt1 1: ?? 1 ???? . 2 px1 1: ? 1 ???? . 1 pt0 1: ?? 0 ???? . 0 px0 1: ? 0 ???? . ? ? : 7 6 5 4 3 2 1 0 ?: saden ?: b9h 7~0 saden ??? 0 ???? saden ?? 1 ? saddr ?????? saden.n ? 0 ??? ????? saden ??0 ??????? i2c ?? : 7 6 5 4 3 2 1 0 i2dat.7 i2dat.6 i2dat.5 i2dat. 4 i2dat.3 i2dat.2 i2dat.1 i2dat.0 ? : i2dat ?: bch 0~7 i2dat i2c ?? i2c ??? : 7 6 5 4 3 2 1 0 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 97 2007.8.16 - - - ?: i2status ?: bdh 0~7 i2status i2c ??? ? 0 5 ????? 23 ? i2status ? f8h ???? i2status ??? i2c ??? ????? (si=1) ??? si ???1? ? ?? i2status si ?0? ???i2status ? ?? 00h ????? ?? ? ?? ????? i2c ??? : 7 6 5 4 3 2 1 0 i2clk.7 i2clk.6 i2clk.5 i2clk.4 i2clk.3 i2clk.2 i2clk.1 i2clk.0 ? : i2clk ?: beh 7~ 0 i2clk i2c ?? i2c ? / ? : 7 6 5 4 3 2 1 0 - - - - - enti div4 tif ?: i2timer ?: bfh 7~3 - . 2 enti i2c14- ? / : 0: ? 14- ? / . 1: 14- ? / 14- ?? ?0? i2c si ??1? ? 1 div4 i2c ?/ ???? 0: 14- ? / ?? fosc 1: 14- ? / ?? fosc/4 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 98 2007.8.16 0 tif i2c ?/ ? : 0: 14- ? / ? . 1: 14- ? / i2c ? (enti) ??si ?0? i2c ????? ?0? i2c ? : 7 6 5 4 3 2 1 0 - ens1 sta sto si aa - - ?: i2con ?: c0h 7 - . 6 ens1 i2c ? 5 sta i2c start ? 4 sto i2c stop ? 3 si i2c ?? 2 aa i2c ?? 1 - . 0 - . i2c ?? : 7 6 5 4 3 2 1 0 i2addr. 7 i2addr. 6 i2addr. 5 i2addr. 4 i2addr. 3 i2addr. 2 i2addr. 1 i2addr. 0 ? : i2addr ?: c1h 7~1 i2addr.7 ~ i2addr1 i2c ?? : 8051 uc ??? 8- ? / ?????? ???? 7 ? mcu ?????? 0 gc ?. 0: ?? . 1: ? . nvm ? : 7 6 5 4 3 2 1 0 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 99 2007.8.16 nvmad dr.7 nvmad dr.6 nvmad dr.5 nvmad dr.4 nvmad dr.3 nvmad dr.2 nvmad dr.1 nvmad dr.0 ? : nvmaddr ?: c6h 7~0 nvmaddr.7 ~ nvmaddr.0 nvm ?: ?????????? nvm ? ??? : 7 6 5 4 3 2 1 0 ta.7 ta.6 ta.5 ta.4 ta.3 ta.2 ta.1 ta.0 ?: ta ?: c7h 7~0 ta ??? : ???????????? ta ? aah ? 55h ???? 3 ???? nvm : 7 6 5 4 3 2 1 0 eer ewr - - - - - - ?: nvmcon ?: ceh 7 eer nvm ? 0: nvm ? 1: ??1? nvm ?? ?ffh? nvm ?4 ??? ? 64 ??? nvmaddr ????????? ???????????? nvm ?? ? 6 ewr nvm 0: nvm . 1: ?? ?1? nvm ??????????? ?????? 5~0 - free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 100 2007.8.16 nvm ?? ? ?? ? 0 00h 3fh 1 40h 7fh 2 80h bfh 3 c0h ffh ? w79e823 w79e822 w79e821 ?? 2 ? 3 nvm : 7 6 5 4 3 2 1 0 nvmda t.7 nvmda t.6 nvmda t.5 nvmda t.4 nvmda t.3 nvmda t.2 nvmda t.1 nvmda t.0 ?: nvm ?: cfh 7~0 nvmdat.7 ~ nvmdat.0 nvm ?? nvm ? movc ?. ?? : 7 6 5 4 3 2 1 0 cy ac f0 rs1 rs0 ov f1 p ?: psw ?: d0h 7 cy ? alu ?? 6 ac ????? 5 f0 ?? 0 ?????? 4 rs1 ?? 3 rs0 ?? 2 ov ?: ?????????? 1 f1 ?? 1: ?????? 0 p ??????? ?1? ?? rs.1-0: ?? : free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 101 2007.8.16 rs1 rs0 ? ? 0 0 0 00-07h 0 1 1 08-0fh 1 0 2 10-17h 1 1 3 18-1fh pwm ? : 7 6 5 4 3 2 1 0 - - - - - - pwmp.9 pwmp.8 ?: pwmph ?: d1h 7~2 - 1~0 pwmp.9 ~pwmp.8 pwm ? 9~8 . pwm 0 ? : 7 6 5 4 3 2 1 0 - - - - - - pwm0.9 pwm0.8 ?: pwm0h ?: d2h 7~2 - 1~0 pwm0.9 ~pwm0.8 pwm 0 ? 9~8 . pwm 1 ? : 7 6 5 4 3 2 1 0 - - - - - - pwm1.9 pwm1.8 ?: pwm1h ?: d3h 7~2 - 1~0 pwm1.9 ~pwm1.8 pwm1 ? 9~8 . pwm 2 ? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 102 2007.8.16 : 7 6 5 4 3 2 1 0 - - - - - - pwm2.9 pwm2.8 ?: pwm2h ?: d5h 7~2 - 1~0 pwm2.9 ~pwm2.8 pwm2 ? 9~8 . pwm 3 ? : 7 6 5 4 3 2 1 0 - - - - - - pwm3.9 pwm3.8 ?: pwm3h ?: d6h 7~2 - 1~0 pwm3.9 ~pwm3.8 pwm3 ? 9~8 . pwm ?? 3 : 7 6 5 4 3 2 1 0 - - - - - - - bkf ?: pwmcon3 ?: d7h 7~1 - 0 bkf ????? . 0: pwm ? . 1: wm ????? ?0? ? : 7 6 5 4 3 2 1 0 wdrun - wd1 wd0 wdif wtrf ewrst wdclr ? : wdcon ?: d8h free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 103 2007.8.16 7 wdrun 0: ??? 1: ? . 6 - ? 5 wdi ? ?? . 4 wd0 ? ?? . 3 wdif ???? ????? 1 ?????? ?????????? 2 wtrf ???? ????????? ?y? ewt0 ???? 1 ewrst 0: ??? . 1: ??? . 0 wdclr ? ?0? wdcon.0 ? ?????? ?? 1 ??? 0 ????? ???? 512 ??????? ??? ??? wdcon ??? 0x0000x0b wtrf (wdcon.2) ?1? ??? ?0? ?ywdif (wdcon.3) ????y? por ?1? ?y ? ewrst (wdcon.1) ?0? ????? wdcon ewrst, wdif wdclr ? ta ??????? ta ? ta reg c7h wdcon reg d8h ckcon reg 8eh mov ta, #aah mov ta, #55h setb wdcon.0 ; ?? orl ckcon, #00110000b ; ?26 ?? mov ta, #aah mov ta, #55h orl wdcon, #00000010b ; ?? pwm ? : 7 6 5 4 3 2 1 0 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 104 2007.8.16 pwmp.7 pwmp.6 pwmp.5 pwmp .4 pwmp.3 pwmp.2 pwmp.1 pwmp.0 ?: pwmpl ?: d9h 7~0 pwmp.7 ~pwmp.0 pwm ?? . pwm0 ? : 7 6 5 4 3 2 1 0 pwm0.7 pwm0.6 pwm0.5 pwm0 .4 pwm0.3 pwm0.2 pwm0.1 pwm0.0 ?: pwm0l ?: dah 7~0 pwm0.7 ~pwm0.0 pwm0 ?? . pwm1 ? : 7 6 5 4 3 2 1 0 pwm1.7 pwm1.6 pwm1.5 pwm1 .4 pwm1.3 pwm1.2 pwm1.1 pwm1.0 ?: pwm1l ?: dbh 7~0 pwm1.7 ~pwm1.0 pwm 1 ?? . pwm ?? 1 : 7 6 5 4 3 2 1 0 pwmrun load cf clrpwm pwm3i pwm2i pwm1i pwm0i ?: pwmcon1 ?: dch 7 pwmrun 0: pwm ? . 1: pwm . 6 load 0: pwmp ????????? 1: ? pwmp ?????? ?0? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 105 2007.8.16 5 cf 0: 10- ?? . 1: 10- ? ?0? 4 clrpwm 1: 10- pwm ? 000h. ?? 3 pwm3i 0: pwm3 1: pwm3 2 pwm2i 0: pwm2 1: pwm2 1 pwm1i 0: pwm1 1: pwm1 0 pwm0i 0: pwm0 1: pwm0 pwm2 ?? : 7 6 5 4 3 2 1 0 pwm2.7 pwm2.6 pwm2.5 pwm2 .4 pwm2.3 pwm2.2 pwm2.1 pwm2.0 ?: pwm2l ?: ddh 7~0 pwm2.7 ~pwm2.0 pwm2 ?? . pwm3 ? : 7 6 5 4 3 2 1 0 pwm3.7 pwm3.6 pwm3.5 pwm3 .4 pwm3.3 pwm3.2 pwm3.1 pwm3.0 ?: pwm3l ?: deh 7~0 pwm3.7 ~pwm3.0 pwm 3 ?? pwm ?? 2 : 7 6 5 4 3 2 1 0 bkch bkps bpen bken pwm3b pwm2b pwm1b pwm0b ?: pwmcon2 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 106 2007.8.16 ?: dfh 7 bkch 6 bkps 0: p0.2=0 ? pwm 1: p0.2=1 ? pwm 5 bpen 4 bken 0: ???. 1: ??? 3 pwm3b 0: ? pwm3 ? 1: ? pwm3 ? 2 pwm2b 0: ? pwm2 ? 1: ? pwm2 ? 1 pwm1b 0: ? pwm1 ? 1: ? pwm1 ? 0 pwm0b 0: ? pwm0 ? 1: ? pwm0 ? ? bpen bkch ? 0 0 ????? bken 0 1 ??pwm (pwmrun=0) ? pwmnb ?pwm ??pwm ? (pwmrun=1) ? 1 0 ???????? pwm pwmrun bkf ?? ??0?. 1 1 ? : 7 6 5 4 3 2 1 0 acc.7 acc.6 acc.5 acc. 4 acc.3 acc.2 acc.1 acc.0 ?: acc ?: e0h acc.7-0: the a ( acc) ??? 8052 ? adc ?? : 7 6 5 4 3 2 1 0 adc.1 adc.0 adcex adci adcs rcclk aadr1 aadr0 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 107 2007.8.16 ?: adccon ?: e1h 7 adc.1 adc ? 1 6 adc.0 adc ? 0 5 adcex =?0? ? adcs ?1? ??adc ? =?1? adcs ?1?? stadc 1.4 ???? adc ? 4 adci adc ?? adc ???? adci ? ?1? adc ???? adc ???? ?0? ? ?0? ?1? ????1? ??? adc ? 3 adcs adc ???? adcs ?1? ?? adc ?? stadc ? ?1? adc ?? adcs=?1? ? adci adcs=?0? adcs=?1? adci =?1? ??? adc ? adci adcs adc ?? 0 0 1 1 0 1 0 1 adc ???? adc ?? ????? adci=0 ????? adci=0 adci=0 ? adcs=1 ????? a/d ?? ?? adci=0 adcs=1 2 rcclk 0: cpu ?? adc ? . 1: ? rc ?? adc ? . 1 aadr1 ? 0 aadr0 ? aadr1, aadr0: adc ?? : adc ??? adci=0 adcs=0 ???? aadr1 aadr0 ?? 0 0 ad0 (p0.3) 0 1 ad1 (p0.4) 1 0 ad2 (p0.5) 1 1 ad3 (p0.6) adc ?? : 7 6 5 4 3 2 1 0 adc.9 adc.8 adc.7 adc. 6 adc.5 adc.4 adc.3 adc.2 ?: adch ?: e2h free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 108 2007.8.16 7~0 adc.9 ~adc.2 adc ? ? 1 : 7 6 5 4 3 2 1 0 - - epwm ewdi ec2 ec1 ekb ei2 ?: ie1 ?: e8h 7 - . 6 - . 5 epwm 0: ???? pwm ? 1: ??? pwm ? 4 ewdi 0: ??? . 1: ??? . 3 ec2 0: ?? 2 . 1: ? 2 . 2 ec1 0: ?? 1 . 1: ? 1 . 1 ekb 0: ? . 1: . 0 ei2 0: ?i2c . 1: i2c . b ? : 7 6 5 4 3 2 1 0 b.7 b.6 b.5 b.4 b.3 b.2 b.1 b.0 ?: b ?: f0h b.7-0: b ??? 8052 ?? ? 0 ? : 7 6 5 4 3 2 1 0 p0id.7 p0id.6 p0 id.5 p0id.4 p0id.3 p0id .2 p0id.1 p0id.0 ?: p0id ?: f6h free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 109 2007.8.16 7~0 p0id.7 ~p0id.0 / ?? 0 . 0: ? 0 1: ?? 0 ? 1 : 7 6 5 4 3 2 1 0 - - ppwmh pwdih pc2h pc1h pkbh pi2h ?: ip1h ?: f7h 7 - . 6 - . 5 ppwmh 1: pwm ??? 4 pwdih 1: ??? 3 pc2h 1: ?? 2 ? 2 pc1h 1: ?? 1 ? 1 pkbh 1: ? 0 pi2h 1: i2c ? ? 1 : 7 6 5 4 3 2 1 0 - - ppwm pwdi pc2 pc1 pkb pi2 ?: ip1 ?: f8h 7 - . 6 - . 5 ppwm 1: pwm ???? 4 pwdi 1: ???? 3 pc2 1: ?? 2 ?? 2 pc1 1: ?? 1 ?? 1 pkb 1: ?? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 110 2007.8.16 0 pi2 1: i2c ?? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 111 2007.8.16 28 ? n79a82x1 ?? 8032 ????????????? ? 8032 ?????? 2 ???? n79a82x1 ?? 4 ????? 8032 ?12 ???? n79a82x1 ? ? ???? 8032 ? 2 ? n79a82x1 ? ???????? ???????????? ? n79a82x1 ? ???????? : ???? ? carry auxiliary carry ? carry auxiliary carry add x x x clr c 0 addc x x x cpl c x subb x x x anl c, x mul 0 x anl c, x div 0 x orl c, x da a x orl c, x rrc a x mov c, x rlc a x cjne x setb c 1 "x" ????? 28.1 ?? ?? n79a82x1 ??????????? ??? n79a82x1 ?? 8032 ??? n79a82x1 ?? 4 ?????????? 4 ??? c1 c2 c3 c4 ? ???????? 2 ?????? ?? 50% ???? ??? n79a82x1 ???????????? ?????? 256 ? 128 ?? n79a82x1 ??? 4 ?????????? 2 ??????? 2 ??????? movx ???? 8032 ???? 2 . n79a82x1 ???? ?2-9 ? rd wr ??????????? ??????? 3 4 5 ? n79a82x1 ?????? 5 ???? 8032 ? 3 ?? n79a82x1 ?? 4 ?????? 8032 ?12 ??? ???? n79a82x1 ??????? 8032 1.5-3 ? ?? ???????? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 112 2007.8.16 single cycle c4 c3 c2 c1 cpu clk ale psen ad<7:0> address <15:0> a7-0 address a15-8 data_ in d7-0 ?? instruction fetch c4 c3 c2 c1 op-code address a15-8 address a15-8 ale psen pc ad<7:0> a ddress<15:0> cpu clk operand fetch c4 c3 c2 c1 operand pc+1 ??? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 113 2007.8.16 operand operand a7-0 a7-0 a7-0 op-code address a15-8 address a15-8 address a15-8 operand fetch operand fetch instruction fetch c2 c3 c4 c2 c3 c4 c4 c3 c2 c1 c1 c1 cpu clk ale psen ad<7:0> a ddress<15:0> 3 ??? operand operand operand op-code address a15-8 address a15-8 address a15-8 address a15-8 a7-0 a7-0 a7-0 a7-0 operand fetch operand fetch operand fetch instruction fetch c2 c1 c4 c3 c2 c1 cpu clk ale psen ad<7:0> a ddress<15:0> c4 c3 c2 c1 c4 c3 c2 c1 c4 c3 4 ??? free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 114 2007.8.16 operand operand operand op-code address a15-8 address a15-8 address a15-8 address a15-8 a7-0 a7-0 a7-0 a7-0 operand fetch operand fetch operand fetch operand fetch instruction fetch c2 c1 c4 c3 c2 c1 cpu clk ale psen ad<7:0> a ddress<15:0> c4 c3 c2 c1 c4 c3 c2 c1 c4 c3 c2 c1 c4 c3 operand a7-0 address a15-8 5 ?? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 115 2007.8.16 29 dc/adc ? / ?? 29.1 ? ? ? dc ? v dd ? vss -0.3 +7.0 v ? v in vss -0.3 v dd +0.3 v ? ta -40 +85 ? c ? tst -55 +150 ? c ???????????? 29.2 dc (ta = -40~85 ? c, ??? ) ? ? ? ? v dd 2.7 5.5 v v dd = 4.5v ~ 5.5v @ 20mhz v dd = 2.7v ~ 5.5v @ 12mhz 18 25 ma v dd = 5.0v @ 20mhz, ? , rst = vss i dd 6 8 ma v dd = 3.0v @ 12mhz, ? , rst = vss 11.5 15 ma v dd = 5.5v, 20mhz, ? i idle 5 6.5 ma v dd = 3.0v, 12mhz, ? 1 10 ? a v dd = 5.5v, ? @ ? bov i pwdn 1 10 ? a v dd = 3.0v, ? @ ?bov p0, p1 i in1 -50 - +10 ? a v dd =5.5v, v in =0< v in < v dd p1.5(rst pin)[1] i in2 -55 -45 -30 ? a v dd = 5.5v, v in = 0.45v p0,p1 ( ?) ? i lk -10 - +10 ? a v dd = 5.5v, 0< v in < v dd p0,p1 ?1 0 ? i tl [*3] -500 - -200 ? a v dd = 5.5v, v in <2.0v 0 - 1.0 v dd = 4.5v p0,p1 ?? (ttl ) v il1 0 - 0.6 v v dd = 2.7v 2.4 - v dd +0.2 v dd = 5.5v p0, p1 ?? (ttl ) v ih1 2.0 - v dd +0.2 v v dd = 3.0v free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 116 2007.8.16 0 - 0.8 v dd = 4.5v xtal1[*2] ?? v il3 0 - 0.4 v v dd = 3.0v 3.5 - v dd +0.2 v dd = 5.5v xtal1[*2] ?? v ih3 2.4 - v dd +0.2 v v dd = 3.0v ( ? ) v ils -0.5 - 0.3 v dd v ( ? ) v ihs 0.7 v dd - v dd +0.5 v ?? v hy 0.2 v dd v p0, p1 ? ( ???? ) i sr1 -150 -210 -360 ? a v dd = 4.5v, v s = 2.4v p0, p1 ( ???? ) i sk2 13 18.5 24 ma v dd = 4.5v, v s = 0.45v - 0.5 0.9 v v dd = 4.5v, i ol = 20 ma p0, p1 ?? ( ?? ) v ol1 - 0.1 0.4 v v dd = 2.7v, i ol =3.2 ma 2.4 3.4 - v dd = 4.5v, i oh = -16ma p0, p1 ?? ( ?? ) v oh 1.9 2.4 - v v dd = 2.7v, i oh = - 3.2ma ??? bov=1 v bo2.5 2.4 - 2.7 v ??? bov=0 v bo3.8 3.5 - 4 v ?? vref 1.02 1.20 1.31 v ? : *1. rst ??? . *2. xtal1 ? cmos . 29.3 adc ?dc (vdd? vss = 3.0~5v, ta = -40~85 ? c, fosc = 20mhz, ? .) ? . ? . ? . ? avin vss -0.2 v dd +0.2 v adc ? adcclk 200khz - 5mhz hz adc ? ?? t c 52t adc [1] us ?? dnl -1 - +1 lsb ? inl -2 - +2 lsb ofe -1 - +1 lsb ge -1 - +1 % ?? ae -3 - +3 lsb ? : tadc: adc ? free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 117 2007.8.16 29.4 ?? (vdd? vss = 3.0~5v, ta = -40~85 ? c, fosc = 20mhz, ? ) ? . ? . ? . ??? v cr 0 v dd -0.3 v ?? cmrr -50 db ?? t rs - 30 100 ns ??? t en - 1 5 us ?? i il -10 0 10 ua 0< v in n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 118 2007.8.16 29.7 ac ?? ?? ? 1/ t clcl 0 20 mhz 29.8 ?? c1 c2 r 4mhz ~ 20 mhz ????? xtal2 xtal1 w79e825 w79e824 c1 c2 r w79e823 w79e822 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 119 2007.8.16 30 ?? 30.1 20-pin sop 20l sop-300mil l o c e h a1 a e b d seating plane y 0.25 gauge plane e 1 20 11 10 7.60 0.32 0.51 0.30 e c b a1 7.40 0.23 0.33 0.10 0.299 0.013 0.020 0.012 0.291 0.009 0.013 0.004 max. dimension in mm 2.65 a symbol min. 2.35 dimension in inch 0.104 min. 0.093 max. control demensions are in milmeters . 1.27 0.10 10.65 l ? y h 08 0.40 10.00 e 1.27 bsc 0.050 0.004 0.419 0 0.016 0.394 8 0.050 bsc e d 12.60 13.00 0.496 0.512 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 120 2007.8.16 30.2 20-pin dip 20l pdip 300mil 1.63 1.47 0.064 0.058 symbol min nom max max nom min dimension in inch dimension in mm a b c d e a l s a a 1 2 e 0.060 1.52 0.175 4.45 0.010 0.125 0.016 0.130 0.018 0.135 0.022 3.18 0.41 0.25 3.30 0.46 3.43 0.56 0.008 0.120 0.375 0.010 0.130 0.014 0.140 0.20 3.05 0.25 3.30 0.36 3.56 0.255 0.250 0.245 6.48 6.35 6.22 9.53 7.62 7.37 7.87 0.300 0.290 0.310 2.29 2.54 2.79 0.090 0.100 0.110 b 1 1 e e 1 1.026 1.040 20.06 26.42 015 0.075 1.91 0.355 0.335 8.51 9.02 15 0 seating plane a e 2 a c e base plane 1 a 1 e l a s 1 e d 1 b b 20 110 11 free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 121 2007.8.16 30.3 16-pin pdip free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 122 2007.8.16 30.4 14-pin pdip free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 123 2007.8.16 free datasheet http://
n79e8251/8241/8231/8221 www.dycmcu.com rev. 1.20 124 2007.8.16 31 ? ???? ?? 251 ?? a 2406 zip:210028 tel: 0086-25-83306839/83310926 fax: 0086-25-83737785 email: yunchao.ding@sykee.net website:http://www.dycmcu.com free datasheet http://
i 2 c,uart,eeprom,adc,pwm,cmp n79e8251/8241/8231/8221 www.dycmcu.com 8flash? rev. 1.20 125 2007.8.16 32 ??????????? ????????????y??? ??????????????? ????????????? ?? http://www.dycmcu.com free datasheet http://


▲Up To Search▲   

 
Price & Availability of N79E8221

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X